Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help for installing php4.1.2 on PWS~~

Status
Not open for further replies.

yinny

Programmer
Jan 11, 2002
5
GB
Hi,

I've just installed php using the InstallShield installer to run on my existing PWS. However, when I tried to test my php scripts, it gives the error 403. Then, I changed the directory permission to have read, execute and scipts checked. When I tried to run the scripts, it still didn't work, saying the following:

"Security Alert! PHP CGI cannot be accessed directly.
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. This variable is set, for example, by Apache's Action directive redirect.

You may disable this restriction by recompiling the PHP binary with the --disable-force-cgi-redirect switch. If you do this and you have your PHP CGI binary accessible somewhere in your web tree, people will be able to circumvent .htaccess security by loading files through the PHP parser. A good way around this is to define doc_root in your php.ini file to something other than your top-level DOCUMENT_ROOT. This way you can separate the part of your web space which uses PHP from the normal part using .htaccess security. If you do not have any .htaccess restrictions anywhere on your site you can leave doc_root undefined. If you are running IIS, you may safely set cgi.force_redirect=0 in php.ini."

I don't really understand what does the above error means. How should I modify my php.ini so that i can run my scripts. I have tried setting cgi.force_redirect to 0 but it didn't work. If anyone knows how to solve this, please tell me. I really need help.

Cheers!
 
I added this line to my php.ini and then RESTARTED pws.

cgi.force_redirect=0

-----------start php.ini
copy of my php.ini

; php.ini for PEAR tests
include_path=..
cgi.force_redirect=0
[mail function]

[Session]

PHP:
-------------end php.ini ***************************************
Party on, dudes!
[cannon]
 
Hi Vinny, KarveR

I got the same error as vinny and did what you suggested Karver, now I'm getting this....

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

(they rest of page was blank)

I am about to throw myself from a great height, can you help me....please
 
Ah, now if I remember rightly you need to copy a couple of dll's into the windoze folder to enable php to operate correctly.
Just can't remeber which ones without digging out my laptop (which I've been looking at all day and have no further desire to today, sorry).

Try double-clicking php.exe and see what errors it throws, I think this will help you figure what you are missing. ***************************************
Party on, dudes!
[cannon]
 
Hi Karver,

Thanks for ur suggestion but it still didn't work after i have set cgi.force_redirect to 0 in the php.ini file and restart my PWS. It still gives the same error message. Do you have any other ideas? thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top