Problems Installing PHP on IIS 5 in 2000Pro

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
mak15
Forum Newbie
Posts: 5
Joined: Thu Jul 06, 2006 2:28 pm

Problems Installing PHP on IIS 5 in 2000Pro

Post by mak15 »

Dear all: I am trying to test some script on my 2000 Pro station before I Install to my 2000Advanced Server. But problem occured. Here is what I did:
1: Unzipped file to c:\php and rename php.ini-dis to php.ini ->
2: edited doc_root = "c:\Inetpub\wwwroot" & extension_dir = "c:\php\ext" in php.ini ->
3: Add the path (c:\php) to PATH in Environment Variables ->
4: moved the php5ts.dll to c:\WINNT.
5: Now I ran the test script (Today is <? print strftime("%m/%d/%Y"); ?>) named it test.php and put it in wwwroot folder.
6: In I.E. typed in http://localhost/test.php, DOESN'T WORK!!! IT came up message exactly as follow:
<p>This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI variable is
set, e.g. via an Apache Action directive.</p>
<p>For more information as to <i>why</i> this behaviour exists, see the <a href="http://php.net/security.cgi-bin">manual page for CGI security</a>.</p>
<p>For more information about changing this behaviour or re-enabling this webserver,
consult the installation file that came with this distribution, or visit
<a href="http://php.net/install.windows">the manual page</a>.</p>

I don't know what did I do wrong, please give me some advices! Appreciated it!

Mak
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You need to edit your php.ini file. Find this section:

Code: Select all

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redirect = 1
cgi.force_redirect = 0
and change the 1 to 0. Restart your server and you should be golden.
mak15
Forum Newbie
Posts: 5
Joined: Thu Jul 06, 2006 2:28 pm

Post by mak15 »

Thank you so much, Everah! It works now!!! :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You're welcome. Enjoy your PHP :D .
Post Reply