Installing PHP 5.2 on IIS6


1. Extract into C:\PHP

2. Rename "php.ini-recomended" into "php.ini"

3. Edit php.ini

extension_dir = "C:\PHP\ext"

[mail function]
SMTP = <SMTP server IP address>
smtp_port = 25
sendmail_from = This email address is being protected from spambots. You need JavaScript enabled to view it.

4. My Computer > System Properties > Advanced > Environment Variables > Path
Add <;C:\PHP> at the end.

5. Reboot the server

6.  Execute (cmd): cscript "C:\Windows\system32\iisext.vbs" /AddFile c:\PHP\php5isapi.dll 1 PHPISAPI 1 PHP-ISAPI (This script creates a new Web Service Extension named "PHP-ISAPI" with a status of "Allowed".

7. IIS Manager > Web Sites > Your_Site > Properties > Home Directory > Configurations > Add
Locate C:\PHP\php5isapi.dll
Enter .php as the Extension


To display PHP errors (for debugging)
php.ini set: display_errors = on

Enable GD (For secireimage, etc)
1. php.ini uncomment: extension=php_gd2.dll
2. Copy file php_gd2.dll from C:\PHP\ext to C:\Windows
3. iisreset

Enable msql (Connection to MS SQL server)
1. php.ini uncomment: extension=php_msql.dll
2. Copy file php_msql.dll from C:\PHP\ext to C:\Windows
3. iisreset
4. If connection fails with "Unable to connect to server" copy ntwdblib.dll from \System32 on SQL server to \System32 on PHP server
Explanation: php_msql.dll extension requites MS SQL client tools to be installed on IIS/PHP server. Alternatively you can copy ntwdblib.dll from SQL server to IIS/PHP server (System 32 directory). This will enable access through named pipes.

Windows Server 2003


Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait