Hi friends,
I'm a blind one. Have a script with $HTTP_SERVER_VARS["PATH_TRANSLATED"] and apache log always complains about undefined index PATH_TRANSLATED. When I run phpinfo(); I can't find it under the server vars section. How to get this? I'm running PHP 4.2.3.
thanks in advance
Instead of this
$HTTP_SERVER_VARS["PATH_TRANSLATED"]
try this
$_SERVER['PATH_TRANSLATED']
PATH_TRANSLATED thats your index.
Hi,
thanks, but same as before. a small echo doesn't show anything. in error_log I find: PHP Notice: Undefined index: PATH_TRANSLATED in
Show us some code you have used
echo str_replace ("\\", "\", substr($SERVER['PATH_TRANSLATED'],0,strlen($SERVER['PATH_TRANSLATED'])-16)); echo str_replace ("\\", "\", substr($HTTP_SERVER_VARS["PATH_TRANSLATED"],0,strlen($HTTP_SERVER_VARS["PATH_TRANSLATED"])-16));
Did you check phpinfo() to see if that variable is set? Or do a print_r of the $_SERVER array?
both not showing PATH_TRANSLATED
this is result of print_r($SERVER);
Array ( [HTTP_ACCEPT] => / [HTTP_ACCEPT_LANGUAGE] => de [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0; T312461; Q312461) [HTTP_HOST] => localhost [HTTP_CONNECTION] => Keep-Alive [HTTP_COOKIE] => PHPSESSID=3ed6e4ffc06f93386d16bb0243a949a9 [PATH] => C:\ORANT\bin;c:\ora9i\bin;C:\Programme\Oracle\jre\1.1.8\bin;C:\mysql\bin;C:\Php\4.2.3;C:\Php\4.2.3\dlls;C:\Php\4.2.3\extensions;C:\Php\4.2.3\Sapi;C:\cygwin\bin;C:\cygwin\lib;C:\cygwin\local\bin;C:\Programme\Oracle\jre\1.1.7\bin;C:\WINNT\system32;C:\WINNT [SystemRoot] => C:\WINNT [COMSPEC] => C:\WINNT\system32\cmd.exe [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH [WINDIR] => C:\WINNT [SERVER_SIGNATURE] => Apache/2.0.40 Server at localhost Port 80 [SERVER_SOFTWARE] => Apache/2.0.40 (Win32) PHP/4.2.3 DAV/2 [SERVER_NAME] => localhost [SERVER_ADDR] => 127.0.0.1 [SERVER_PORT] => 80 [REMOTE_ADDR] => 127.0.0.1 [DOCUMENT_ROOT] => C:/Programme/ApacheGroup/Apache2/htdocs [SERVER_ADMIN] => user@mail.com [SCRIPT_FILENAME] => C:/Programme/ApacheGroup/Apache2/htdocs/test3.php [REMOTE_PORT] => 2229 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => [REQUEST_URI] => /test3.php [SCRIPT_NAME] => /test3.php [PHP_SELF] => /test3.php )
Are you sure Apache 2 for Win32 supports that variable? It doesn't look like it to me....
it seems you are right, but unfortunaly nobody else has tried the same with Apache2. I searched around all known sources and can't find a hint. This could be a problem for a lot projects when they using vars like this. Back to my problem: do I have an alternative way to do what I want to?
no, it must be possible to get this working. I've found an example on the net which shows the same aspects as my system: http://zwemruben.xs4all.nl/test/default.php (this is the phpinfo(); output of the server)