PHP 5 on Windows 2003 Server (IIS)

Here are my notes on setting up PHP 5.1.6 on a Windows 2003 server (SBS).

  1. Must have “c:/php/” in system PATH environment variables (must reboot server when changing).
  2. In IIS under Web Service Extentions must have c:\php\php5isapi.dll Enabled.
  3. In IIS under the default web site (and particular web site to use PHP), configure the Application extention for .php to have path “C:\PHP\php5isapi.dll”, limit verbs to “GET,HEAD,POST”.
  4. Put php.ini in the c:\windows directory. The ISAPI extention didn’t find the ini file in the php directory.
  5. Add IUSR_Machinename to the PHP directory.
  6. In the php.ini file, hard code the extentions path, i.e. extension_dir = “c:/php/ext/”.
  7. In the php.ini file, comment out the doc_root line, i.e. ‘;doc_root = “c:\Inetpub\wwwroot” ‘.
  8. In the php.ini file, hard code the path to the session.save_path, i.e. ‘session.save_path = “c:/php/sessiondata” ‘.
  9. Add IUSR_Machinename write permission to the sessiondata and file upload folders.
  10. In the php.ini folder, turn display_errors = On to see error information.
  11. Always restart IIS when making changes to the php.ini file.
  12. Use this function to test PHP:
    <?php
    phpinfo();
    ?>
  13. Run PHP from a dos prompt at the PHP folder to view any missing DLL’s. This does not test the ISAPI extention pathing though.

Hope this helps someone. I found the PHP documentaion to be a bit lacking. At the time of this writing there was not an installer for PHP 5 (at least that I could find). I was also upgrading from PHP 4 (cgi) and MySQL 4 to MySQL 5.

Some of the trouble I encountered was a completely white screen (no error message at all), MySQL would not load into PHP, and “No input file specified” (doc_root).