Configure PHP on XP Pro with IIS (Internet Information Service)

By admin. Filed in Uncategorized  |  
TOP del.icio.us digg

Recently, I had the rather unpleasant experience of having to reformat the hard drive on my computer, and subsequently re-install Windows XP Pro, PHP, MySQL, and a host of other programs. This turned out to be entirely worth my time investment, as it now runs like it was brand new. However, I had some difficulty with Microsoft’s IIS (Internet Information Service) and PHP/MySQL, so I have decided to list off the specific directions to help anyone else that may be in my predicament. If you follow these steps exactly then you shouldn’t have any issues.

My System (for comparison)
• MS XP Pro
• Service Pack 2
• Intel Core 2 Duo @2GHz
• 3.25 GB RAM

1) Install Microsoft IIS onto your computer. For this step you will probably need the Windows software cd that came with your computer.
a. Go to Control Panel
b. Click on Add/Remove Windows Components
c. Check IIS, hit “Next” follow on-screen directions

2) Download PHP from http://www.php.net/downloads.php. Currently I am using version 5.2.9.
a. Extract the Zipped files to C:\PHP. (PHP’s website

3) PHP 5 includes a CGI executable and a CLI executable as well as the server modules. All .dll files for PPHP can be found in the folder C:\PHP\ext

4) Add php5ts.dll to the Environmental Services PATH
a. Click on “Start”
b. Right-click on “My Computer”
c. Select “Properties”
d. Select “Advanced”
e. Select “Environmental Variables”
f. In the bottom panel, scroll to and double-click on “PATH” at the end of the statement, add “;C:\PHP” Do NOT forget the semi-colon, and do NOT change anything else!
g. Click “OK” on the Environmental Variables window and then on the System Properties window. Restart Computer.

5) Configure PHP.
a. Navigate to C:\PHP
b. Rename php.ini-recommended to php.ini and open in any text editor
c. Search for “doc_root”
d. Delete preceding semi-colon and change to “doc_root=C:\inetpub\wwwroot
e. Search for “cgi.force_redirect”
f. Delete preceding semi-colon and change to “cgi.force_redirect=0″

6) Configure IIS
a. Click on “Start”
b. Right-click on “My Computer”
c. Select “Manage”
d. Maximize “Services and Applications”
e. Right-click on “Web Sites” and select “Properties”
f. Under the “ISAPI Filters” tab click on “Add”, set filter name to “PHP”, set Executable to “C:\PHP\php5isapi.dll”
g. Under the “Home Directory” tab set “Execute Permissions” to “Scripts Only”
h. Under the “Documents” tab click “Add” and enter “index.php” and Click “ok”
i. Click on “OK” for the “Web Sites Properties” window.
j. Restart IIS
i. Right-click on “Internet Information Services” in the “Computer Management” window
ii. Select “ALL Tasks” then “Restart IIS”, then select “OK”

7) Test PHP
a. Open a text editor (such as Notepad)
b. Enter in this:
c. Make sure to save as “phpinfo.php” in the directory “C:\inetpub\wwwroot”;
d. in Notepad, when saving, select the file type as “All Files”. If the file is saved as .txt it will not work.
e. Open up your favorite browser and use this link:
i. http://localhost/phpinfo.php
f. Your browser should now display a complete listing of PHP attributes.

Done!

Next time, configuring MySQL to work with PHP.

Please don’t hesitate to link to this article!

Comments are closed.