This article will aid you with installing, configuring, and running PHP 5 or greater in synchronization with IIS 6.0 on a Windows Server 2003 operating system. This combination is quite popular and can be very useful for those who are comfortable with a Microsoft Windows environment.
The following is assumed:
- Microsoft Windows Server 2003 is Installed, Configured, and Running
- PHP (http://www.php.net) files have been uploaded to default directory and has been properly configured, including any modifications to PHP.ini
- PHP Default Install (directory) Location is C:\PHP
- Default configurations and permissions exist
- Microsoft IIS 6.0 is Installed, Configured, and Running
The first thing you’ll need to do is open IIS manager. Go to Start >> Run then type inetmgr and click OK
This will open the IIS manager. Next do these steps.
- Select and Highlight Web Service Extension in the right-hand panel
- Click on “Add New Web Service Extension” in the left-hand panel
- Type PHP as the Extension Name
- Click Add and Browse to PHP Install Location (i.e. C:\PHP\php5isapi.dll)
- Check the box to Set the Extension to Allowed
PHP Script Configuration
Now you’ll need to add the php5isapi.dll as an application extension in the website configuration. Make sure IIS manager is still open
- Select and Highlight Web Sites Container in the right-hand panel
- Right-click on the Web Sites Container and Select Properties
- Select the Home Directory Tab
- Change Execute Permissions to Scripts Only (or Scripts and Executables if needed. NOTE: if you do not need “Scripts and Executables” or not sure then choose Scripts Only)
- Click on the Configuration Button
- Under Application Extensions Click on Add
- For Executable Field Browse to C:\PHP\php5isapi.dll
- Type .php in the Extension Field
- Select Limit To for the Verbs and type GET,HEAD,POST in the Verbs Limit To Field
- Leave All Other Defaults and Click OK
- Click OK All the Way Out
PHP 5+ should now be properly configured to work with IIS 6.0 on Windows Server 2003.
Test IIS and PHP config
Test that PHP works with your IIS configuration
- Create a new website in IIS (or use an existing website)
- In the root directory of your website create a file called “phpinfo.php”
- Inside the phpinfo.php file type or copy/paste the following lines:
- Save the file in the root directory of your website
- Open your web browser and navigate to the file by typing http://www.YOURWEBSITENAME.com/phpinfo.php into your web browser
If you see the PHP configuration page then PHP is successfully installed and works with IIS. If you do not see the PHP configuration page and receive a blank or error page then you should troubleshoot the issue and retry the steps above.
Do you have any questions, suggestions, or feedback? Then let’s here it, leave a comment below.