Skip to content

Activate PHP (X64) under Windows 2008 R2 and IIS 7.5 using ISAPI

30. August 2009

A short description how to activate PHP5 (X64) under IIS7.5 (Windows 2008 R2 X64):

One thing before: I found some solutions in which it was explained how to activate PHP5 with FastCGI – these solutions didn’t work for me so I decided to use the “old” Isapi way.

1. Download a PHP X64 Version (for example from http://fusionxlan.com/PHPx64.php (php-5.2.5-x64-2007-11-12.zip))

2. Extract the files to a temporary folder

3. Copy everything that is inside of the extracted folder “php-5.2.5 (x64)” to a new folder (for example) “C:php”

4. Activate the “ISAPI IIS Role Service” with the Server Manager (or the power shell)
clip_image002

5. Rename the file “C:phpphp.ini-recommended” to “php.ini”

a. Open the php.ini and change the following things:
    i. Activate the option “open_basedir” and point it to the folder where the website(s) files are located.
    ii. Activate the option “extension_dir” and point it to a folder where the PHP extensions can be found. In a typicall installation it would be:
       extension_dir = “./ext”
    iii. Activate the required php extensions (uncomment the needed “lines”) for example:
          extension=php_mssql.dll
          extension=php_mysql.dll

b. To test if the PHP installation is successful, run the following from the command line prompt:
       C:PHP>php –info
    If everything is correct a lot of php infos are displayed now.

6. Open Internet Information Services (IIS) Manager from the Startmenu

7. Open “Handler Mappings”
clip_image004

8. Choose: “Add Module Mapping”
clip_image006

9. Add the following entries:

a. Request path: „*.php“
b. Module: „IsapiModule“
c. Executable: „C:phpphp5isapi.dll“
d. Name: „PHP via Isapi“
clip_image008
e. Confirm with „OK“

10. Allow the „Isapi extension“
clip_image010

11. For testing if the mapping works correctly creat a file called “phpinfo.php” in C:inetpubwwwroot. Insert this code into the file:

<?php phpinfo(); ?>

12. Now you can open the phpinfo file in a WebBrowser:

http://SERVERNAME/phpinfo.php

or if you are logged on to the web server:

http://localhost/phpinfo.php

You will now see the default php Info page:
clip_image012

13. Finished – now you can use php scripts in your IIS 7.5 under Windows 2008 R2 64 Bit

From → General

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: