Last post Jul 09, 2010 03:19 PM by marioparris
Jul 09, 2010 04:50 AM|Jeevecore|LINK
Jul 09, 2010 11:05 AM|marioparris|LINK
So here's the fix. The IIS Developer Express Server is IIS 7. Which means it can be configured the same way. RTFM? So
following the instructions here, we can add the PHP handler via the CLI. We don't need to add FastCGI since the Express server comes with it built in.
But there's a catch, we need to change the paths. The configuration for the Express server is not in your WinDir, it is in the WebMatrix program files directory. So we need to change the path to the configuration utility and bada-bing bada-boom.
So, here's a ready to go snippet, perfect for batch files. You will of course need to change the
full path to your PHP runtimes.
"C:\Program Files\Microsoft WebMatrix\appcmd.exe" set config /section:system.webServer/fastCGI /+[fullPath='C:\Library\PHP\php-5.3.1-nts\php-cgi.exe']"C:\Program Files\Microsoft WebMatrix\appcmd.exe" set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='C:\Library\PHP\php-5.3.1-nts\php-cgi.exe',resourceType='Unspecified']
Jul 09, 2010 01:33 PM|Jeevecore|LINK
Jul 09, 2010 02:08 PM|ruslany|LINK
Jeevecore: the easiest workaround for this it to install any PHP application by using Webmatrix UI. When you do that the WebMatrix will properly register PHP with IIS Express (e.g. create the handler mapping).
Jul 09, 2010 02:34 PM|Jeevecore|LINK
Jul 09, 2010 03:19 PM|marioparris|LINK
Initially I tried the method ruslany used, but that didn't work. It simply installed PHP 5.2 for my existing IIS 5.1, changing my original PHP setup, and not Web Matrix. And I needed PHP 5.3 :)
If adding it via the command line is utitlity isn't working (silly spaces). I would simply move my PHP installation to a path without spaces :) Say C:\PHP. That's a pretty common setup, and then just change the path in the commands to C:\PHP\php-cgi.exe
Also, you may want to uninstall the PHP which the Web Platform installer installed for you, and setup your PHP install manually using the zip archive. Or just using the MSI installer, being sure to set C:\PHP as the installation folder :). Just follow the
instructions on the PHP manual for setting up PHP to work with FastCGI and you should be good to go.
Actually, you can just follow ruslany's instructions in the article I linked to previously:
http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/#InstallPHP :) Just realised it's his article. Much thanks!