1. Download PHP (do not get the installer, just the zip package). I would recommend the latest version 5 release.
  2. Extract the downloaded zip file to a folder on your root drive, i.e C:\PHP.
  3. Copy the file “C:\PHP\php.ini-dist” to your Windows directory.
  4. Rename the copied file to “php.ini”.
  5. Open the php.ini file and make the following changes:
    • Locate the line reading: [mail function] (~line 672). Edit the line below this section for “SMTP” accordingly. For the most part your SMTP server will remain the default value of “localhost”.
    • Locate the line starting with: extension_dir (~line 475). Change the directory to “C:\PHP\ext”
    • Locate the line starting with: session.save_path (~line 966). Uncomment this line and change the directory to your system’s temp directory, most likely “C:\Windows\Temp” (you will need to allow full control for the “Everyone” group to this folder).
    • Locate the line reading: ; Windows Extensions (~line 580). Remove the semicolon in front of the following lines:
      • extension=php_mbstring.dll
      • extension=php_mysql.dll
      • extension=php_mysqli.dll
  6. Save and change the php.ini file.
  7. Open IIS.
  8. Go to the Web Service Extensions section and click “Add a new Web service extension” with the following settings:
    1. Extension name set to “PHP”
    2. Add the file: “C:\PHP\php5isapi.dll”
    3. Check the box to set the extension.

    Installing PHP on IIS

  9. Click Ok and now PHP should be listed in the extension list.
    Installing PHP on IIS
  10. Right click on the Web Sites section and select Properties.
  11. On the Home Directory tab, click the Configuration button.
    Installing PHP on IIS
  12. In the Application Configuration dialog under the Mappings tab, click Add.
    Installing PHP on IIS
  13. Set the application mapping settings as follows:
    1. Executable: “C:\PHP\php5isapi.dll”
    2. Extension: “.php”
    3. Uncheck the box for “Verify that file exists”. This is not needed (since we aren’t going to be moving the PHP files) and adds overhead to the execution time of PHP scripts if checked.

    Installing PHP on IIS

  14. Click Ok until all IIS dialogs are closed.
  15. Restart IIS by going to Start > Run and entering: “iisreset”
    Installing PHP on IIS

PHP is now installed on your IIS Server. To test it, you can make a file called “info.php” and adding this as the text:

<?php phpinfo(); ?>

If everything was installed correctly, you should see an informational page with all the details of your PHP version and configuration settings. Once you see this, PHP is up and running on your server.

Leave a Reply