Installing PHP 5.2 on IIS6

Installation

1. Extract php-5.2.10-Win32.zip into C:\PHP

2. Rename “php.ini-recomended” to “php.ini

3. Edit php.ini

extension_dir = “C:\PHP\ext”

[mail function]
SMTP = 192.168.0.1 <SMTP server IP address>
smtp_port = 25
sendmail_from = webmaster@company.com

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
Limit to: GET,HEAD,POST

Configuration

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

 


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *