Page 1 of 1

Blonde & STILL getting Security: PHP CGI cannot be ...

Posted: Thu Aug 08, 2002 5:25 am
by designguru
okay enough is enough...I';ve read many of these postings but i'm still not getting it going....(PHP that is)

my error is this:
Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled

I have changed the cgi.redirect value to 0 as stated in many of these logs, but i still can't access my .php script !!!

I have PWS running, MySQL running and since I'm a newbie (with skills) and stuck way down here in New Zealand (where support is something undeard of) I really need some help...

can anyone assist ?? if i need to change the php.ini to doc_root i'll need a hand to code that line (hopeless i know)

cheers..

Posted: Thu Aug 08, 2002 5:48 am
by twigletmac
Just to check do you have this in your php.ini:

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 = 0
the last line should not have a semi-colon (;) in front of it because that comments it out.

Mac

Posted: Thu Aug 08, 2002 4:40 pm
by designguru
yep.

(it must be true what they say about blondes !!!!!!)

Posted: Thu Aug 08, 2002 4:45 pm
by designguru
I also have this line in the php.ini (which is commented out)..perhaps it should comment it in ??...

; cgi.redirect_status_env=;

some more background info:

- running win98 os
- running PWS, home directory is c/inetpub/wwwroot - i ticked execute...
- when i open php.exe i get the msdos-style window, but nothing shows on it, and i can't even type exit to close it down....does php just run in the background, or do i need to do something else with it to get it running?
- I'm also using d/w mx to do the editing of scripts.
- i've used the info.php script i found in a tutorial, but can't even get that working....!!!
- MySQL is running and all seems to be at ease with this..

:wink:
-

Posted: Fri Aug 09, 2002 1:58 am
by twigletmac
PWS seems to be just about the worst web server for running PHP on judging by the number of posts about it not working properly (although it works fine for one of my work collegues who has to use Win 98 and can't upgrade). You might find installing and running Apache an easier and less frustrating solution.

Mac

Posted: Fri Aug 09, 2002 2:50 am
by designguru
I'd have to agree.....PWS seems to be an open can of worms...and i don't like worms much....

cheers 4 your help....no doubt i'll be back with apache queries soon....chow4now..