Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install PHP in IIS 7.5, Windows Server 2008 R2 (64bits)

In http://windows.php.net/downloads I couldn't find any x64 built for download. Further I have to choose among "Thread Safe" and "Non Thread Safe" with no explanation whether one is safer than the other or it performs better. The install.txt inside the available ZIPs for download seems out-dated an it doesn't mention anything about this.

In http://php.net/manual/pl/install.windows.iis7.php they don't say a word about it either...

Another doubt is once I know what to download (and why), should it be setup as a FastCGI module or as an ISAPI extension?

like image 355
Toni Rosa Avatar asked Aug 09 '10 23:08

Toni Rosa


2 Answers

(My experiences running PHP under IIS)

I believe that you should set up PHP as a FastCGI module - I don't think you are able to set up PHP as an ISAPI extension. You can set up PHP either using FastCGI or ISAPI - It may be that ISAPI is faster than FastCGI. There is a guide on setting up IIS using ISAPI here:

  • http://www.lazynetworkadmin.com/knowledgebase-mainmenu-6/2-windows/141-install-php-on-server-2008-r2

Searching google reveals a lot of pages discussing the thread safe vs non thread safe argument if you want to know the detail, however the short version is that the non thread safe version is faster, but the thread safe version is safer. You should choose the thread safe version for now unless you have a performance problem and know that your app is going to run correctly under the non thread safe binaries.

Finally, there isn't really any need for x64 binaries when running PHP as a FastCGI application - php runs as a separate process and so the x86 binaries will run fine on a x64 web server, and most normal php applications will have no need for an address space above 4GB as to scale IIS can simply start additional php processes.

When configuring your FastCGI extension you need to point it at the php-cgi.exe executable in the php installation directory.

like image 124
Justin Avatar answered Oct 21 '22 23:10

Justin


I often use FastCGI when setting up PHP on IIS. It is moreso habit than anything else. While I did read over many of the other articles posted and it does appear that ISAPI has many advantages I thought I'd add a link to setting up FastCGI for those who want to go that route. I've used it and never had any issues with moderate request traffic.

Anyway here's a link to an article with screenshots on setting up PHP via FastCGI on IIS 7.5.

Click here to visit the article.

like image 35
Joe Meyer Avatar answered Oct 21 '22 22:10

Joe Meyer