REDIRECT_STATUS Environment Variable

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
ale
-


Joined: 12 Dec 2007
Posts: 6
Location: Italy

PostPosted: Wed Dec 12, 2007 8:01 pm    Post subject: REDIRECT_STATUS Environment Variable Reply with quote

I chose to install PHP without using the preconfigured package as a learning experience. I had a few problems at the beginning until in "FastCGI (Local - Pipes)" I changed the Type option from "PHP Style" to "Standard" but now PHP 5.2.5 seems to run nicely with Abyss X1 on Windows. I installed phpBB and MediaWiki without problems.

Now the only question left is: I still need the REDIRECT_STATUS environment variable set to 200 or maybe this setting was related to the choice of "PHP Style" and thus not needed anymore?

Thanks
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Dec 13, 2007 7:08 pm    Post subject: Re: REDIRECT_STATUS Environment Variable Reply with quote

ale wrote:
I chose to install PHP without using the preconfigured package as a learning experience. I had a few problems at the beginning until in "FastCGI (Local - Pipes)" I changed the Type option from "PHP Style" to "Standard" but now PHP 5.2.5 seems to run nicely with Abyss X1 on Windows. I installed phpBB and MediaWiki without problems.


PHP versions >= 5.2.4 no more need "PHP Style" and are fully CGI compliant so you can safely set the style to "Standard".

Quote:
Now the only question left is: I still need the REDIRECT_STATUS environment variable set to 200 or maybe this setting was related to the choice of "PHP Style" and thus not needed anymore


The REDIRECT_STATUS variable requirement can be removed by altering your php.ini (set cgi.force_redirect = 0).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
ale
-


Joined: 12 Dec 2007
Posts: 6
Location: Italy

PostPosted: Fri Dec 14, 2007 5:01 pm    Post subject: Reply with quote

So to recap we have two possibilities

a) Generally PHP default is cgi.force_redirect = 1, like in the Windows installer offered on the PHP web site and we need to declare a REDIRECT_STATUS custom environment variable as explained in http://www.aprelium.com/abyssws/php.html

b) or like in the preconfigured PHP package offered here where php.ini has cgi.force_redirect set to 0 and in fact http://www.aprelium.com/abyssws/php5win.html doesn't mention the need of a REDIRECT_STATUS variable


I read in the PHP manual

About cgi.force_redirect
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 at your own risk.
Note: Windows Users: You can safely turn this off for IIS, in fact, you must. To get OmniHTTPD or Xitami to work you must turn it off.

About cgi.redirect_status_env
If cgi.force_redirect is turned on, and you are not running under Apache or Netscape (iPlanet) web servers, you may need to set an environment variable name that PHP will look for to know it is OK to continue execution.
Note: Setting this variable may cause security issues, know what you are doing first.

So to my understanding these are mostly security settings but may impact functionality and the "right" choice is OS dependant and web server dependant

For Abyss on Windows is there a preferred or suggested setting, or maybe a) and b) outlined above are equivalent?

A comment about cgi.redirect_status_env which seems tied to the cgi.force_redirect setting?

Sorry for the lenghty post...
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Dec 14, 2007 7:16 pm    Post subject: Reply with quote

ale,

REDIRECT_STATUS is not needed for Abyss Web Server (nor is the CGI force redirect thing which has been made for Apache and other servers). So you can safely ignore it and set cgi.force_redirect to 0.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
ale
-


Joined: 12 Dec 2007
Posts: 6
Location: Italy

PostPosted: Fri Dec 14, 2007 8:24 pm    Post subject: Reply with quote

Thanks for the clear and concise answer, I understood
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group