The simplest script:
<?php echo 'hello';
[Thu Jul 01 08:37:21 2010] [error] [client 127.0.0.1] PHP Notice: Undefined variable: ref in D:\\data\\o\\WebProjects\\elearning\\application\\modules\\clientarea\\controllers\\ViewController.php on line 578, referer: http://elearning/clientarea/view/course/teid/1/cid/1
It's commonly suggested that this problem is caused by your firewall interfering or by having IPv6 enabled at your network interfaces, however those solutions didn't fix the issue for me. It turns out that by default Windows 7 hosts file at "C:\Windows\System32\drivers\etc\hosts" has this line commented out:
# 127.0.0.1 localhost
In my case, simply uncommenting this line changed the localhost performance back to what it was supposed to be, instead of that annoying 3-5 second wait on every page load. Remember that you need to run your text editor with administrator rights to edit the hosts file.