Archive

Archive for May, 2007

Running PHP 5.2 in IIS 5.1

May 6th, 2007

*Assuming you have IIS 5.1 installed.

1. Download php zip files from www.php.net/downloads

(php 5.2.0 is the most recent version at this time – Jan 2007)

2. Unzip all contents to C:\PHP

3. The file php5ts.dll needs to be available to IIS, you have 3 options here:

3.1 – Copy php5ts.dll to c:\Inetpub\wwwroot
or
3.2 – Copy php5ts.dll to c:\windows\system32
or
3.3 – Add c:\PHP to PATH environment variable (right click My Computer, properties, advanced tab, environment variables, under system variables highlight PATH, click Edit, add ;C:\PHP to the end of the line. Click OK all the way out.

4. Configure the php.ini (inside C:\PHP). Open php.ini-recommended, save it as php.ini.

-scroll down and edit this:

4.1 doc_root = C:\Inetpub\wwwroot (this is how php knows where to run.)

4.2 cgi.force_redirect = 0

Configure IIS to use PHP
1. Open the IIS console (control panel, administrative tools) and highlight websites or whatever your home directory is called.

2. Right click, choose properties, set “Execute permissions to “Scripts only”

3. Click configuration, click add, set executable to C:\PHP\php5isapi.dll, set extension to .php , click OK all the way out.

4. Setting ISAPI Filters: click Add, set filter name to PHP, set executable to C:\PHP\php5isapi.dll , click OK all the way out.

5. Restart IIS

Test PHP Script:
1. Open up notepad, type and save as test.php inside C:\Inetpub\wwwroot

2. Preview http://localhost/test.php

Notes: If you want to allow the extensions to be used (including mySQL, etc) you need to edit the php.ini file, under “Directory in which the loadable extensions reside”
extension_dir = C:\PHP\ext

REFERENCES:
http://www.stockvault.net/articles/Tutorial_-_Installing_PHP_on_IIS_51_&40;Wi…

About the author
Chris Alexander is an IT Professional for a large corporation as well as a freelance web designer. Read more about him at http://www.studiothreehundred.com

Tech