Loading

Faster PHP in IIS? Use FastCGI

Faster PHP? use FastCGI

 

Ever thought that PHP runs a bit slow on your IIS (6/7) server, well with the new addition of FastCGI you can get an increase in performance of up to 20 times faster.

 

What you need to do for IIS 6 and PHP 5.2.6;

 

First download the latest PHP version from http://www.php.net/downloads.php  

User the Installer version

Install to c:program filesphp – or a folder of your choice

When installing select IIS Fastcgi

 

Second download FastCGI for IIS6 from http://www.microsoft.com/downloads/details.aspx?FamilyID=2d481579-9a7c-4632-b6e6-dee9097f9dc5&displaylang=en

Edit C:WINDOWSSystem32inetsrvfcgiext.ini

Add the following to the bottom of the file

 

[Types]

php=PHP

 

 

[PHP]

ExePath=C:Program FilesPHPphp-cgi.exe

InstanceMaxRequests=10000

EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000

RequestTimeout=500

ActivityTimeout=900

 

Save the file

 

Restart IIS

Confirm that PHP works

 

============

PHP test file phptest.php

 

<?php phpinfo(); ?>

 

============

 

Bit more of a boost Install eAccelerator http://www.eaccelerator.net/

 

============

 

Troubleshooting

 

If you receive the following error, it is likely that you have a configuration issue with PHP, or the requests are timing out

 

************

FastCGI Error
The FastCGI Handler was unable to process the request.
——————————————————————————–

Error Details:

The FastCGI process exceeded configured activity timeout
Error Number: 258 (0x80070102).
Error Description: The wait operation timed out.
HTTP Error 500 – Server Error.
Internet Information Services (IIS)

*****************

 

First check PHP; rename php.ini to php.old (make sure that no other php.ini file exists) iisreset, now confirm that PHP loads if PHP now works disable all extensions and test each on in turn.

 

If page is timing out increase the ‘requesttimeou’ in fcgiext.ini

 

Leave a Reply

Your email address will not be published. Required fields are marked *