IIS - PHP installed as CGI

I’ve installed IIS and PHP in my laptop so I could run ASP and ASP.NET applications as well as PHP applications. I run Windows 7. Installing PHP has been a bit complicated. I downloaded the latest msi file from php.net and installed it, but php wouldn’t work. So I tried downloading and extracting the zip file, and changing the configuration manually. That didn’t work as expected.

Finally, I dowloaded Microsoft’s php installer (Or should I say generic installer? (it also installs other componets such as silverlight, MVC and more) and the installer did all the job, installing PHP for me and it worked… only that PHP is running as CGI and that’s not what I wanted.

Is this the way is supposed to be? Because I think it is not.

I know that PHP as CGI has its limitations but should I bother to try to re-install PHP again?

Note: I used this very installer to install Silverlight (just curiosity) and funny enough it gave an error. Don’t know if this has anything to do… maybe my IIS configuration is not right, although I used the generic configuration.

I would not bother with installing PHP and binding to CGI, FastCGI is the preferred route.

btw, we just released a new module called PHP Manager. It’s open source and is great at troubleshooting issues with PHP on Windows/IIS. Another nice feature is that it allows you to configure multiple versions of PHP for IIS. You can have one web using 5.2 and another using 5.3. Very cool. It also detects and fixes any config settings it finds. You can check it out here, http://www.microsoft.com/web/php/


The only functions I know that don’t work are the Apache specific functions, which wouldn’t work on IIS to begin with. But PHP is looking at CGI for future advancement, adding in a new FastCGI Process Manager just recently. http://us3.php.net/manual/en/install.fpm.php

Yet another question comes into my mind… Are you saying that I can have two different versions of PHP installed in the same machine and same IIS server?
You can as long as the two have different file extensions. Or you override the global configuration at a site/domain level. Very useful for testing.

Should the second installation done as CGI too? or should I just installed as normal. My problem is that everything I’ve read about installing PHP is in English, the information in Spanish is too vague… but my IIS is in Spanish and the English names of the different buttons and areas you need to configured can’t be directly translated into Spanish. I know what they want me to do, but I don’t know its name in Spanish :frowning:

Thanks logic. I didn’t remember the partnership between Zend and Microsoft, to be honest.

Some PHP functions do not work while for CGI and quite common so it is a bit annoying and I truly don’t understand the logic behind this.

Yet another question comes into my mind… Are you saying that I can have two different versions of PHP installed in the same machine and same IIS server?

I can actually answer this. On IIS 7/7.5 (Windows 7 comes with IIS 7.5), using FastCGI is the prefered way of using PHP on IIS. Microsoft actually made the FastCGI extension for IIS with PHP in mind, during the partnership between Zend and Microsoft (if you recall that).

The installer you used “Microsoft Web Platform” installed PHP using FastCGI bindings. Should it should be good as is. No need to try and reinstall unless you want a different version. I have written a guide for manual installation for PHP/IIS in the PHP forum if you need assistance.