Tutorial tested on Windows Server 2003 Standard with Ensim.
Ok, as I had really big problems installing PHP as ISAPI on my Windows 2003 Standard Server using any of the How-TOs from here and other manuals posted I decided to post my own tutorial with a few editions to the rest.
You can also read this tutorial if you are experiencing problems with PHP pages loading slowly i.e. poor PHP performance under IIS.
We are now going to install PHP 4.3.7 (which is the latest version right now) as ISAPI module on Windows 2003 Standard Server. Should work with Ensim boxes as well as with normal Standard Servers.
A > Pre-Installation Steps:
1) Remove any previously installed CGI version of PHP (Start > Settings > Control Panel > Add or Remove Programs)
2) Make sure there are no php.ini files left that could interfer with the new installation (only keep old php.ini files if you know what you're doing)
3) Stop IIS (yes I know your websites will be down, but I just want to make sure all dlls are unloaded so you can replace any previously installed ones, so do this step at low server load times)
B > Downloading, Extracting and Copying Files:
1) Go to http://at.php.net/get/php-4.3.7-Win32.zip/...p/from/a/mirror and downloaded the zip file (I suggest doing this remote on your server, since you don't need the files on your local computer)
2) Extract ALL(!) files from the zip to C:PHP and make sure all old files are replaced
3) Copy all files in C:PHPdlls to C:WINDOWSsystem32 and make sure all files are replaced if existen
NOTE: if libeay32.dll can't be replaced rename the file to libeay32.old and copy the new file
4) Copy php4isapi.dll from C:PHPsapi to C:WINDOWSsystem32 (replace any old file)
5) Copy php4ts.dll and php4ts.lib from C:PHP to C:WINDOWSsystem32 (php4ts.dll always has to be in the location of php4isapi.dll
6) copy C:PHPphp.ini-recommended to C:WINDOWSphp.ini
C > Setting File Permissions:
1) Right-click the file C:WINDOWSphp.ini and select Properties - in the Security tab make sure that the user group "Users" has Read and Read & Execute permissions to this file
2) Repeat this step for the C:PHP directory so the "Users" user group has Read and Read & Execute permissions (this is vital if you need any extensions from C:PHPextensions
D > Configure and Optimize php.ini
1) Open C:WINDOWSphp.ini and alter these settings if they are not set like this:
- output_buffering = on
- zlib.output_compression = Off (only turn it on when you know what you're doing as this setting causes instability on some systems)
- extension_dir = "c:PHPextensions"
- Below "Dynamic Extensions" remove the ; in front of all extensions you need (for better perfomance don't load extensions you don't require for your scripts!)
E > Configure and Start IIS
1) Start > Run > inetmgr
2) Open "Web Service Extensions" on local computer
3) Add a new Web Service Estension:
- Extension name "PHP 4.3.7 ISAPI"
- Add... C:WINDOWSsystem32php4isapi.dll
- Check the box "Set extension status to allowed"
4) In the inetmgr window go to Web Sites and right-click Defaul Web Site to open its Properties
5) Change to the Home Directory tab and click "Configuration"
6) Add a new Application Extension:
- Browse for C:WINDOWSsystem32php4isapi.dll
- Set Extension to .php
- Limit verbs to GET,HEAD,POST (only use All verbs if you know what you're doing)
- Uncheck verify that the file exists
7) FINAL STEP... Start IIS
I hope this tutorial helped all those people trying to use PHP as isapi module who have unexplainable problems although they followed a usually working tutorial