Configuration of PHP with IIS on Windows 2003
This article contains instructions for setting up PHP with IIS on Windows 2003.- Download the Windows "zip package" of PHP. In this example I used version 5.1.4.
- Unzip the contents of the file into the "C:\php" directory.
- Add "C:\php" to the System Path.
- Click the "Start" button, then right-click on "My Computer" and select the "Properties".
- Select the "Advanced" tab and click the "Environment Variables" button.
- In the "System variables" frame, highlight the "Path" variable and click the "Edit" button.
- Add ";C:\php" to the end of the "Variable value" text, then click the "OK" buttons on all dialogs until you have exited the "System Properties" dialog.
- Reboot the server.
- Copy the "C:\php\php.ini-recommended" file to "C:\php\php.ini".
- Make sure the following parameters are set correctly in the php.ini:
- cgi.force_redirect = 0
- doc_root = "c:\Inetpub\wwwroot"
- Open the IIS Manager dialog (Start > Administration Tools > Internet Information Service (IIS) Manager).
- Configure up the relevant website as follows:
- On the tree, right-click on the relevant Website and select the "Properties" menu option.
- Select the "Home Directory" tab and click the "Configuration" button.
- On the "Mappings" tab, click the "Add" button.
- Enter "C:\php\php5isapi.dll" as the "Executable" and ".php" as the "Extension". Accept the other default settings by click the "OK" buttons on all dialogs until you return the main screen.
- Configure the Web Service Extensions as follows:
- On the tree, click on the "Web Service Extensions" node.
- Click on the "Add a new Web service extension..." link in the right-hand pane.
- Set the "Extension name" to "PHP", add "C:\php\php5isapi.dll" as a "Required file" and check the "Set extension status to Allowed" checkbox, then click the "OK" button.
- Restart the IIS Admin Service in the "Services" dialog (Start > Administrative Tools > Services).
- Create a file called "C:\Inetpub\wwwroot\phpinfo.php" with the following contents.
<?php phpinfo(); ?>
- Then test the configuration by using this URL (http://localhost/phpinfo.php) in a browser on the server.
Hope this helps. Regards Tim...
Back to the Top.
