Friday 20 January 2012

How to enable PHP Extension in Windows Server 2003 IIS 6.0.

Installing PHP:-

1.    Download PHP.
2.    Create a directory in C:\PHP as installation directory. Then extract the files from php-5.1.4-Win32.zip into C:\PHP.
3.    Locate the file ‘php.ini-recommended’ in C:\PHP and rename it to ‘php’. (without the quotes of course)
4.    Open the ‘php.ini’ file and find the line which reads extension_dir = “./” and change it to extension_dir = “C:\PHP\ext”.
5.    Add the location of PHP directory to the server’s PATH environment variable so that Windows knows where to look for any PHP related executables (such as the PHP extension DLL‘s).
-To do this Right-click on My Computer,
-click Properties
-On the Advanced tab click Environment Variables.
-In the Environment Variables dialog box, under System variables highlight the Path variable and click Edit.
-Add ‘;C:\PHP’ (be sure to include the semi-colon separator) and click OK.
6.    Re-boot the server for this change to take effect.

----------------------------------------------------------------------------------

Configuring IIS to work PHP under IIS 6.0:-

 
1.    First we need to create and then enable an appropriate Web Service Extension so that IIS will both recognise and allow PHP files to be processed by the appropriate script engine.

2.    There is easier way of doing this by using the ‘iisext.vbs’, which we can find in C:\Windows\System32. Once we have this “iisext.vbs” file, we have to run below command in command prompt under C:\Windows\System32 directory.

cscript iisext.vbs /AddFile c:\PHP\php5isapi.dll 1 PHPISAPI 1 “PHP ISAPI”

3.    Now we can see, this script creates a new Web Service Extension in IIS, named “PHP ISAPI” with a status of Allowed.
----------------------------------------------------------------

For more information and screen shots on this, go to http://www.iisadmin.co.uk/?p=4

No comments:

Post a Comment