Things you need before Installation
This post assumes that you have that IIS 6.0 running on Windows 2003. In case you need assistance, refer to this website Installing IIS 6.0. Before getting started, we need the following tools:
- FastCGI which is variation CGI, developed to reduce the overheads between the web server and the CGI programs.
- Microsoft Visual C++ 2008 SP1 Redistributable Package which is required by PHP.
- Microsoft Drivers for PHP for SQL Server (if you plan to communicate PHP with MS SQL Server 2005 or higher).
- And of course PHP 5.3 (always prefer the ZIP file)
- Install both FastCGI and Visual C++ 2008 Package.
- Unzip and extract PHP to C:\php (For the rest of the post, I will refer to it as the PHP directory)
- Inside the PHP directory you will find a file named php-production.ini, create a copy of this file and rename it to php.ini
- Open the php.ini to make the following changes. Uncomment the lines by removing the semicolon (;) and update the values.
extension_dir = "C:\php\ext" error_log="C:\inetpub\temp\php-errors.log" cgi.force_redirect = 0 fastcgi.impersonate = 1 fastcgi.logging = 0 cgi.fix_pathinfo=1
- Now to configure FastCGI, Open the command prompt and move to the folder C:\Windows\System32\inetsrv
- Execute the following three commands:
cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe" cscript fcgiconfig.js -set -section:"PHP" -InstanceMaxRequests:10000 cscript fcgiconfig.js -set -section:"PHP" -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000
- Restart IIS and test if PHP is running