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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
designguru
Forum Newbie
Posts: 5
Joined: Thu Aug 08, 2002 5:25 am
Location: new zealand

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

Post 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..
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
designguru
Forum Newbie
Posts: 5
Joined: Thu Aug 08, 2002 5:25 am
Location: new zealand

Post by designguru »

yep.

(it must be true what they say about blondes !!!!!!)
designguru
Forum Newbie
Posts: 5
Joined: Thu Aug 08, 2002 5:25 am
Location: new zealand

Post 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:
-
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
designguru
Forum Newbie
Posts: 5
Joined: Thu Aug 08, 2002 5:25 am
Location: new zealand

Post 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..
Post Reply