Page 1 of 1

Re: Can't get PHP to work with IIS 7.0

Posted: Sat Jul 24, 2010 8:19 am
by internet-solution
Having two webservers on the same PC can be tricky. Most probably you will have to assign separate ports for each webservers, otherwise they will both listen to port 80 for http requests and can throw up errors.

If you want to run PHP under IIS then install php5 module for IIS.

Re: Can't get PHP to work with IIS 7.0

Posted: Sat Jul 24, 2010 10:53 am
by liljester
with iis and php i prefer not to use the installer. uninstall your wamp installer thing...

download the latest php version in ZIP format. Unzip to a php folder somewhere like c:\program files\php\. append "c:\program files\php" to your PATH. copy the php.ini-production to c:\windows, and rename it to php.ini. set extension_dir = "c:\\program files\\php\\ext" in the php.ini. you can also enable any extensions you want to use.

open IIS manager, click on you webserver on the left. under IIS on the right, double click "handler mappings". click add module mapping and give it the following info:
request path: *.php
module: fastCgiModule
executable: c:\program files\php\php-cgi.exe
name: PHP
click ok. confirm the next popup (something about enabling).

now click the back button (top left) to go back to the main iis manager. under IIS again double click "default Document". click add. enter "index.php" click ok.

click back again, click restart on the right to restart IIS, and you should be serving up php pages. if your server doesnt show you php errors (only generic error pages) you need to enable "detailed errors" by double clicking "error pages" then click edit feature settings, and select detailed errors.

also note, IE8 also has a setting to show generic error pages in its internet options, you may have to correcthat too.

good luck and let me know how it goes!

Re: Can't get PHP to work with IIS 7.0

Posted: Sat Jul 24, 2010 9:46 pm
by liljester
did you create a module mapping as i suggested and point it to php-cgi.exe?

Re: Can't get PHP to work with IIS 7.0

Posted: Sun Jul 25, 2010 5:26 am
by internet-solution
When I installed the PHP5 under IIS, I just downloaded the Webplatform installer 2.0 RC from Microsoft website and selected PHP 5.2.11 extension during installation. It worked out of the box on a Windows XP machine. I suggest removing your current PHP install and try web platform installer.

Re: Can't get PHP to work with IIS 7.0

Posted: Sun Jul 25, 2010 10:54 am
by liljester
ah, i do apologize, i assumed you were using windows server 2008. ive never installed php on vista or windows 7 IIS.