PHP 5.3 on IIS gives 404 error in CGI mode

Posted by reinier on Server Fault See other posts from Server Fault or by reinier
Published on 2009-06-24T20:14:15Z Indexed on 2010/04/01 10:13 UTC
Read the original article Hit count: 535

Filed under:
|
|

Slowly losing my mind here. I had PHP 5.2 working fine (ISAPI) under IIS, but for some extension I needed 5.3. So no worries, I installed this but it turns out ISAPI is not supplied anymore.

I followed the install tutorials for fastcgi and ended up with a 500 internal server error for every PHP page served.

So my current situation is: I have fastcgi removed. In my websites I have added PHP (head, get, post) and routed them to c:\php\php-cgi.exe.

Result: every PHP page I try (even the ones with just text) gives 404 not found error. Any HTML file I put in the same folder, serves without a hitch.

Who can help me please... How hard can something like this be right? For me apparently very hard.

Extra information:

  • ran the installer as suggested below. Set it to use fastcgi.

  • my fcgiext.ini file looks like this now:
    [types]
    php=c:\php\php-cgi.exe
    [c:\php\php-cgi.exe]
    exepath=c:\php\php-cgi.exe

  • from the command-line a 3 line PHP file with just phpinfo(); works fine

  • from the server the same PHP file with just phpinfo(); results in the internal server 500 error.
  • from the server a PHP file with just text works fine
  • when changing the document types in IIS management console and point the PHP extension directly to c:\php\php-cgi.exe results in 404 for every PHP file
  • the php.ini is the php.ini.production file which came in the distribution. No edits were made.

Setting the IIS PHP handler directly to PHP (not via fastcgi) c:\php\php-cgi.exe results in the following:

  • display a PHP page with only text....works fine
  • display a page with only phpinfo(); results in 404 not found

© Server Fault or respective owner

Related posts about cgi

Related posts about php