|
Posted by Csaba Gabor on 01/09/07 19:26
Does anyone know what the deal is on ORIG_PATH_INFO vs. PATH_INFO?
I use the "real" path_info from the server
(e.g. in http://webcomp.org/index.php/something/else,
the path_info is /something/else) that used to be found in
$_SERVER["PATH_INFO"]
However, under Apache 1.3.37 with a System:
Linux host45.hostmonster.com 2.6.17-11_4.BHsmp #1 SMP Fri Nov 17
17:14:51 MST 2006 x86_64
and PHP 5.1.6. CGI (on http://hostmonster.com)
regardless of the setting of cgi.fix_pathinfo, whether 0 or 1.
On the other hand, $_SERVER['ORIG_PATH_INFO'] returns the correct
information in the above setup.
So is the PHP version/Server independent way of doing this supposed to
be something like:
$path_info = @$_SERVER['ORIG_PATH_INFO'];
if (!$path_info) $path_info = @$_SERVER['PATH_INFO'];
Csaba Gabor from Vienna
See also http://bugs.php.net/bug.php?id=31892
Searching for ORIG_PATH_INFO on php.net's online documentation turned
up nothing.
Some references: http://hoohoo.ncsa.uiuc.edu/cgi/env.html
http://at.php.net/manual/en/ref.apache.php
http://nl2.php.net/reserved.variables
Finally, as an aside, note that you can do function lookups in on
php.net by writing something like the very pretty:
http://php.net/pathinfo
It is tempting to say that this is an example of PATH_INFO at work
(with an implied index.php), but it is not. For PATH_INFO to work, the
explicit URL, including the file, must be provided (e.g.
http://php.net/index.php/pathinfo which leads to the main php page).
To get apache to behave as you would expect it to behave, you have to
do URL rewriting within apache. Too bad.
Navigation:
[Reply to this message]
|