Bug #1623: Inconsistent/incorrect PATH_TRANSLATED
| From: | greg at elysium dot ltd dot uk | Date: | Tue, 29 Jun 1999 10:44:05 +0000 |
| Subject: | Bug #1623: Inconsistent/incorrect PATH_TRANSLATED | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-7796@lists.php.net to get a copy of this message | ||
From: greg@elysium.ltd.uk
Operating system: Linux 2.0.35
PHP version: 3.0.9
PHP Bug Type: Misbehaving function
Bug description: Inconsistent/incorrect PATH_TRANSLATED
(Under Apache 1.3.6.)
There is a contradiction between the value PHP returns for PATH_TRANSLATED and the value displayed
by phpinfo, e.g. in the following script (foo.php3):
print "$PATH_INFO<BR>\n";
print "$PATH_TRANSLATED<BR>\n";
phpinfo();
I first noticed the problem when trying to get a script to act as a handler for files in a
subdirectory (using a .htaccess file with AddHandler and Action directives), but the problem is more
general.
PATH_INFO always seems to agree with phpinfo, and PATH_TRANSLATED always seems to be the full
pathname of the actual PHP script, regardless of what phpinfo says.
For example, fetching "http://www/~greg/foo.php3" complains only that
PATH_INFO is uninitialised, and says PATH_TRANSLATED=/home/greg/public_html/foo.php3, whereas
phpinfo does not display either PATH_INFO or PATH_TRANSLATED in this case. Fetching "http://www/~greg/foo.php3/bar" agrees with
phpinfo that PATH_INFO=/bar, but says PATH_TRANSLATED=/home/greg/public_html/foo.php3 (same as the
first example), whereas phpinfo says PATH_TRANSLATED=/var/lib/htdocs/bar (definitely wrong).
This could be an Apache bug as well/instead, but phpinfo needs correcting if the Apache version of
the variable is actually inaccessible to PHP...