Portal Home > Knowledgebase > Articles Database > PHP execution lags / installation problem?
PHP execution lags / installation problem?
Posted by bobble, 07-06-2009, 02:13 PM |
Hi
Something has been driving me crazy and is becoming a massive problem on some big DB driven sites in PHP.
Lets say I have a file, doesnt even need to have any PHP functions in the document, could be just pure CSS / images. Say I have a copy of this file named something.html and a copy named something.php, the php one takes about 5 times longer to load than the html page. You can see 90% of the page loads and then it sticks with the loading bar nearly fininshed, waits a while and then pings to finished and the remaining parts of the site load (usually footer links etc).
This has me stumped, even has my hosts stumped. Would any one have any idea why this may happen? Something to do with the installation directory of PHP or location of php.ini?
This is on a Windows 2003 machine running IIS6, I have tested the same files on a Linux installation and its perfectly fine.
Any help at all would be greatly appreciated.
|
Posted by Avalon Systems, 07-06-2009, 04:17 PM |
PHP can be mind numbingly slow on IIS6 (as opposed to IIS7, which is exceptionally fast).
Is your host running it through FastCGI or ISAPI? Further to this, there's an old "fix" floating around for slow PHP implementations on IIS6.
php.ini
output_buffering = on
Ask your host to set that value as restart IIS for it to take effect.
|
Posted by bobble, 07-06-2009, 04:21 PM |
Thanks for the reply.
Its actually one of 4 dedicated servers we have so i have direct access to php.ini. Another chap on a different forum suggested the same buffering solution but its not made any difference.
We didnt install PHP however, and i cant recall how to check which installation they went for. Isnt the ISAPI one the one generally considered to be the quickest?
|
Posted by RBBOT, 07-06-2009, 07:03 PM |
Have you verified your results aren't being skewed by caching in temporary internet files? Static files (.html) will be sent by IIS with HTTP headers that allow the content to be cached, whereas php files will be sent by default with HTTP headers that say the content needs to be fetched from the server every time.
|
Posted by bobble, 07-07-2009, 10:40 AM |
Turns out it was the PHP API being used. I hadnt noticed but our hosting company set PHP up in CGI mode, we switched to FastCGI and it fixed the issue.
We're going to put the other server in ISAPI and compare, i thought ISAPI was the quickest.
Thanks for all your replies.
|
Add to Favourites Print this Article
Also Read