# PATH_TRANSLATED broken?

- Thread: https://externals.io/message/3026
- Original archive: https://news-web.php.net/php.internals/3026
- Started by Derick Rethans on 2003-06-30T09:57:36+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #3026 — Derick Rethans — 2003-06-30T09:57:36+00:00

URL: https://externals.io/message/3026#3026

Hey,

with this URL: http://dru-nl/b.php/1/r/2/1/1
I get back the following server variables (PHP 5.0.0b1, apache 1 
module):
  'REQUEST_URI' => '/b.php/1/r/2/1/1'
  'SCRIPT_NAME' => '/b.php'
  'PATH_INFO' => '/1/r/2/1/1'
  'PATH_TRANSLATED' => '/home/httpd/html/dru/modules/user/1/r/2/1/1'
  'PHP_SELF' => '/b.php/1/r/2/1/1'

Shouldn't PATH_TRANSLATED be?
  'PATH_TRANSLATED' => '/home/httpd/html/dru/modules/user/b.php/1/r/2/1/1'

regards,
Derick

-- 

-------------------------------------------------------------------------
 Derick Rethans                                 http://derickrethans.nl/ 
 JDI Media Solutions                             http://www.jdimedia.nl/
 International PHP Magazine                      http://www.php-mag.net/

---

## #3031 — Uwe Schindler — 2003-06-30T11:30:08+00:00

URL: https://externals.io/message/3026#3031 · In reply to: #3026

I think your problem with that comes from the fact, that in PHP4 the apache 
sapi module define this variable in the wrong way (mistake of original 
programmer). But a lot of scripts depend on that so we did not fix it in 
the PHP_4_3 branch. I think there is a former discussion about this in this 
mailing list! But PHP5 should follow the CGI spec: 
http://www.graphcomp.com/info/specs/cgi11.html

To get your version of the variable it would be better for the scripter to 
use $_SERVER['SCRIPT_FILENAME'].$_SERVER['PATH_INFO']

By the way in PHP4 all other SAPI modules do the translation in the right way.

At 11:57 30.06.2003 +0200, Derick Rethans wrote:
>Hey,
>
>with this URL: http://dru-nl/b.php/1/r/2/1/1
>I get back the following server variables (PHP 5.0.0b1, apache 1
>module):
>   'REQUEST_URI' => '/b.php/1/r/2/1/1'
>   'SCRIPT_NAME' => '/b.php'
>   'PATH_INFO' => '/1/r/2/1/1'
>   'PATH_TRANSLATED' => '/home/httpd/html/dru/modules/user/1/r/2/1/1'
>   'PHP_SELF' => '/b.php/1/r/2/1/1'
>
>Shouldn't PATH_TRANSLATED be?
>   'PATH_TRANSLATED' => '/home/httpd/html/dru/modules/user/b.php/1/r/2/1/1'
>
>regards,
>Derick
>
>--
>
>-------------------------------------------------------------------------
>  Derick Rethans                                 http://derickrethans.nl/
>  JDI Media Solutions                             http://www.jdimedia.nl/
>  International PHP Magazine                      http://www.php-mag.net/
