27-05-2009

PHP configuration Quick manual install of PHP on windows IIS 6

This list of PHP installation instructions sums up actions needed to do a minimal setup of php on you IIS windows webserver

the official php manual installation guide can be found here :http://www.php.net/manual/en/install.windows.manual.php

  1. Download binaries and extract to C:\php (http://www.php.net/downloads.php)
  2. To make php4ts.dll / php5ts.dll available add your PHP directory, C:\php to the PATH. Read more about how to add your PHP directory to PATH in the corresponding FAQ entry (and then don't forget to restart the computer - logoff isn't enough).
  3. Rename php.ini-recommended to php.ini and copy to location where php can reach it - http://php.net/manual/en/configuration.file.php
  4. Edit php.ini :

    extension_dir = C:\php\ext

    and uncomment the extensions you need - for instance

    extension=php_gd2.dll

    session.save_path = "2;C:\tmp"


  5. The IIS user needs permission to read various files and directories, such as c:\php, php.ini, docroot, and the session tmp directory.
  6. Open IIS manager - rightclick & open the properties of your website. Under ISAPI Filters, add a new ISAPI filter. Use PHP as the filter name, and supply a path to the php4isapi.dll / php5isapi.dll.
  7. Under 'Home Directory' change the Execute Permissions to 'Scripts only'
  8. Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the appropriate ISAPI DLL. An example PHP 5 value is: C:\php\php5isapi.dll Supply .php as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times.
  9. Stop IIS completely (NET STOP iisadmin)
  10. Start IIS again (NET START w3svc)
  11. With IIS 6 (2003 Server), open up the IIS Manager, go to Web Service Extensions, choose "Add a new Web service extension", enter in a name such as PHP, choose the Add button and for the value browse to either the ISAPI file (php4isapi.dll or php5isapi.dll) then check "Set extension status to Allowed" and click OK.
  12. If you experience 100% CPU usage after some time, turn off the IIS setting Cache ISAPI Application.

Comments:

Your comment:

»
bleh 11/12/2009, 1:54 pm

To get rid of 404 error, ensure that your executable mapping for the .php extension is properly coded. Start->Control Panel->Administrative Tools->Internet Information Services-> (select web site) ->Properties->Home Directory->Configuration->Mapping and then change the Executable Path for .php files from C:Program~PHPphp5is~1.DLL (or whatever crazy path) to "C:Program FilesPHPphp5isapi.dll"

 

[x]