PHP delay of 1 second on every script on localhost on Windows 7
Every PHP script takes at least one second to display in the browser when run on localhost. Why is this happening?
If I have a file say test.html that has the word TEST in it and file test.php that has the word TEST开发者_JAVA技巧 in it (without any PHP tags, identical files just different extensions), the PHP file takes one second to execute and display in the browser while the HTML file loads instantly.
I have a Phenom II X6 @ 3.2GHz, CPU utilization is near 20% on one core at lowest voltage when any (even empty) PHP file is called. There is no noticable HDD activity. According to phpinfo() Server API is CGI/FastCGI
The problem was solved by using PHP as an Apache module rather than CGI. I had to revert to PHP 5.2 because 5.3 something something blah blah won't work with Apache 2 because of Visual C 9 or something. Whatever, works great now
精彩评论