#24886 [Asn->Csd]: PATH_TRANSLATED is wrong
| From: | iliaa@php.net | Date: | Thu, 31 Jul 2003 23:00:38 +0000 |
| Subject: | #24886 [Asn->Csd]: PATH_TRANSLATED is wrong | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-45146@lists.php.net to get a copy of this message | ||
ID: 24886
Updated by: iliaa@php.net
Reported By: lenar at city dot ee
-Status: Assigned
+Status: Closed
Bug Type: Apache related
Operating System: debian/unstable
PHP Version: 4.3.3RC2
Assigned To: iliaa
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-07-31 16:21:56] iliaa@php.net
Note to self, maybe related to bug #24883.
------------------------------------------------------------------------
[2003-07-31 16:12:00] lenar at city dot ee
Really it's hard to explain this.
One thing is for sure:
echo $_SERVER['PATH_TRANSLATED'] and echo $PATH_TRANSLATED
give different outputs.
register_globals is _on_.
Actually after studying it seems that $PATH_TRANSLATED
gets the same value that is in $_ENV['PATH_TRANSLATED']
which in turn seems to be DOCUMENT_ROOT but sometimes it
is not the correct DOCUMENT_ROOT but document root of some
other virtual host.
But anyway it should be easily testable to some degree
with this code:
<? echo $PATH_TRANSLATED . "\n"; echo
$_SERVER['PATH_TRANSLATED']; ?>
I get:
/var/www/
/home/user/public_html/index.php
My variables_order = "EGPCS"
So I would expect the value in $_SERVER to be accessible
by $PATH_TRANSLATED not the one in $_ENV.
Why the value in $_ENV sometimes contains the path of some
other virtul host's document root is still beyond me.
Apache is 1.3.27
------------------------------------------------------------------------
[2003-07-31 13:23:05] sniper@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2003-07-31 11:05:31] lenar at city dot ee
Description:
------------
in apache configuration where many virtual hosts are in
use, PATH_TRANSLATED doesn't always get set to correct
path.
Instead the value seems to reflect some other (older)
request. Possibly the value is correct only if brand new
apache child serves the request.
The value in $_SERVER array is always correct.
Current workaround: add extract($_SERVER, EXTR_OVERWRITE);
to your auto-prepend php file.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24886&edit=1