Alex Rivera | Logout

How to Run PHP on IIS7.5 Express?

Asked 2011-08-16T15:02:03.527
16

I have Win XP SP3 and have installed IIS7.5 Express and want to run PHP on it.

I am able to run simple HTML code on the server, I am able to start and stop the server by running iisservices.exe, but I am not able to run php scripts on it.

If I have the following PHP file:

<? php 
echo "hello world";
?>
<html>HI</html>

The output is HI but the PHP script doesn't run.

I have followed the steps described in this article to install PHP:

http://learn.iis.net/page.aspx/724/install-and-configure-php/

But can't proceed from step 10 onwards because IIS Express doesn't have an IIS Management Console MMC snap-in.

How do I configure IIS Express to run PHP?

Edit
Report

2 Answers

4

Option-1: (From command line)

  1. Go to IIS Express installation folder (%programfiles%\iis express)

  2. Run following two commands

appcmd.exe set config /section:system.webServer/fastCGI /+[fullPath=**'c:{php_installation-folder}\php-cgi.exe'**] 

appcmd.exe set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='.php',verb='',modules='FastCgiModule',scriptProcessor='c:{php_installation-folder}\php-cgi.exe',resourceType='Unspecified'] 

Option-2: (Using UI)

  1. Install WebMatrix (from http://www.microsoft.com/web/webmatrix/)

  2. Start WebMatrix and choose 'Site From Folder' option and select your php file folder and click OK

  3. In the WebMatrix left pan select Settings (bottom of the left pan select 'Site' and on the top of the left pan select 'Settings')

  4. In the settings tab, check the PHP check box, this would install PHP and configure for you.

  5. Click 'Restart' button in WebMatrix to restart IIS Express

  6. In WebMatrix left pan bottom select 'Files' and on the top of the left pan (tree view), you should see your php page and now right click on this page node and select 'Launch in Browser'

answered 2011-08-16T23:54:17.247
-4

Download php installer.

It should let you choose what type of server, so choose IIS and then it should work from there.

answered 2011-08-16T15:06:35.680

Your Answer