|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24886 PATH_TRANSLATED is wrong
Submitted: 2003-07-31 11:05 UTC Modified: 2003-07-31 18:00 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: lenar at city dot ee Assigned: iliaa (profile)
Status: Closed Package: Apache related
PHP Version: 4.3.3RC2 OS: debian/unstable
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: lenar at city dot ee
New email:
PHP Version: OS:


 [2003-07-31 11:05 UTC] lenar at city dot ee
in apache configuration where many virtual hosts are in 
use, PATH_TRANSLATED doesn't always get set to correct 
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. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-31 13:23 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

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 16:12 UTC] lenar at city dot ee
Really it's hard to explain this. 
One thing is for sure: 
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 
I get: 
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 16:21 UTC]
Note to self, maybe related to bug #24883.
 [2003-07-31 18:00 UTC]
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
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 00:01:28 2024 UTC