[thelist] install PHP on IIS (which is already running ASP)

DESCHAMPS Stéphane DSI/SICOR stephane.deschamps at francetelecom.com
Wed Oct 8 04:05:45 CDT 2003

Dunstan Orchard:

> If so, can anyone think of anything else I need to tell/warn 
> them about?

Hi Dunstan,

<tip type="IIS and PHP" author="notabene">
I've had a fair amount of trouble with PHP as CGI on an IIS4, and here's my collection of tips so far.

1. If a .php file is not found, IIS still runs the CGI and since the file is not there, the CGI returns an error. Make sure you have the "check the existence of file" in your PHP-as-CGI configuration window checked so that the 404 is handled as it should be (although it is said to slow the server down a little)

2. A simple phpinfo() will show you you don't have exactly the same variables as those you're used to if you know PHP+apache.

3. If your 404 error page is a PHP file, be careful: the requested URL is not detected as such (as would PHP under Apache do). Instead the error location is passed as an internal query string like such:
"404;http://myserver.com/thepageimlookingfor" (and IIS4, having found a page to be served, sends a 200 and not a 404, although I'm told it's been solved in IIS5 and later)

4. Redirection headers are treated weirdly on IIS4: the page you're supposed to be redirected to is correctly served, but the URL doesn't change, thus generating more trouble than imagined. We almost systematically resort to redirection metas, although it's not as clean as headers.

s t e f (aka notabene)

More information about the thelist mailing list