Installing PHP on IIS6

Version 0.1

Get the latest version from http://www.php.net/downloads.php. Be sure to get the ZIP archive and not the MSI installer under the “Windows Binaries” section, PHP 4.3.10 zip package for example. The MSI installer only installs the CGI interpreter and not the module for IIS. Unzip the archive to the directory c:\php

Set the permissions on the c:\php directory.
Add read and execute for everyone, IUSR_machinename, networkservice.

Set the webroot.

Cut the c:\inetpub directory and paste it to e:
Create session and upload directories.
Create e:\inetpub\sessiontemp and e:\inetpub\uploadtemp directories and set the permissions:
Add read and execute to everyone. Add modify to iuser_machinename and network service.

Set permissions on e:\inetpub\wwwroot.

Add read and execute to everyone and to iuser_machinename. Add full control to network service. Apply to all sub files/dirs.

If e:\inetpub\adminscripts exists, rename or delete it.

Change the path.

Under environment variables, select path and edit. Add to the end:
c:\php;c:\php\dlls

You will have to reboot for this to “really” take effect, but not yet.

Copy c:\php\php.ini-dist to c:\php\php.ini and edit. Change to the following:

max_execution_time = 90
memory_limit = 16M 
log_errors = On 
html_errors = Off 
magic_quotes_gpc = Off 
include_path = ".;c:\php;c:\intranet\php\pear" 
extension_dir = "c:\php\extensions" 
upload_tmp_dir = E:\Inetpub\uploadtemp 
upload_max_filesize = 20M 
SMTP = email.up.edu 
sendmail_from = webmaster@up.edu 
session.save_path = E:\Inetpub\sessiontemp 

Uncomment these:

extension=php_gd2.dll 
extension=php_iconv.dll 
extension=php_ldap.dll 
extension=php_mssql.dll 
extension=php_pdf.dll 

Now MOVE (so it retains its permissions) php.ini to c:\windows

Under the IIS mmc, select Web Service Extensions > Add new web service extension…

Enter .php for the extension (don’t for get the .) and select C:\php\sapi\php4isapi.dll for the Required files. Check Set extension to be allowed and OK.

Expand Websites and right click Default Web Site and click properties.
Under the Home Directory click the Configuration button. Under Mappings click Add and add C:\php\sapi\php4isapi.dll for the executable and .php for the extension and hit OK.

Under the Documents tab add index.php.

Reboot.