From: Whit B. <wh...@tr...> - 2004-05-16 23:16:27
|
On Mon, May 17, 2004 at 12:50:04AM +0200, Oliver Betz wrote: > http://bugs.php.net/bug.php?id=21575 and > http://bugs.php.net/bug.php?id=23800 mention it. Strange that the > search function doesn't find both... Eh. I was using php.net's link to the Google search that gave: "Your search - ORIG_PATH_INFO site:www.php.net - did not match any documents." - but of course that's not searching bugs.php.net. > It can be configured (cgi.fix_pathinfo in php.ini), but I'm not sure > whether it is a bug or intended behaviour, so I can't tell my web > hoster to change it. > > Any comments? The PHP manual seems to be totally lacking on this. However there's a comment in php.ini about it: ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting ; this to 1 will cause PHP CGI to fix it's paths to conform to the spec. A setting ; of zero causes PHP to behave as before. Default is zero. You should fix your scripts ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. ; cgi.fix_pathinfo=0 So it looks like your host is running PHP as a CGI, and that in CGI mode PHP formerly didn't really have access to PATH_INFO so it just wasn't provided (it was available in the more usual mode of running PHP as an Apache module). However, the related PATH_TRANSLATED was kludged to copy the available SCRIPT_FILENAME value. Then this was fixed for one version of PHP, but that broke scripts expecting to find that kludged value or SCRIPT_FILENAME, so php.ini was set to have cgi.fix_pathinfo=0 - which breaks things for you because you need the fix to be ther for the PATH_INFO variable. So ... your provider can change to cgi.fix_pathinfo=1 (removing that ";" before it) in php.ini, and you'll be good - but anyone else on the system using PATH_TRANSLATED in a script (this could be grepped for) needs to change to SCRIPT_FILENAME or their script will then be broken. Whit PS: Reini is of course right on the "SERVER_" stuff - I'm don't always run in safe mode (too many old, old scripts). |