471,896 Members | 1,349 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,896 software developers and data experts.


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

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

Finally, as an aside, note that you can do function lookups in on
php.net by writing something like the very pretty:
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.

Jan 9 '07 #1
0 3534

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Preston Crawford | last post: by
1 post views Thread by divya | last post: by
4 posts views Thread by Chuck Anderson | last post: by
reply views Thread by fmcarol | last post: by
2 posts views Thread by undbund | last post: by
12 posts views Thread by Michael Windsor | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.