#18942 [Opn->]: $PHP_SELF is set to HTTP_SERVER_VARS[PATH_INFO] if available

From: Date: Sat, 17 Aug 2002 14:01:52 +0000
Subject: #18942 [Opn->]: $PHP_SELF is set to HTTP_SERVER_VARS[PATH_INFO] if available
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17121@lists.php.net to get a copy of this message
ID: 18942 Updated by: kalowsky@php.net Reported By: six@aegis-corp.org -Status: Open +Status: Won't fix Bug Type: Other web server Operating System: Debian PHP Version: 4.2.2 New Comment: The manual states why this shouldn't used, and the fact that it's populated at all is interesting. Previous Comments: ------------------------------------------------------------------------ [2002-08-17 09:41:56] six@aegis-corp.org I believe it should be fixed ... Or at least the apache SAPI should be modified too. With the current code, PATH_INFO has different meanings (and values) in the Apache and CGI SAPIs, not good at all for applications portability IMHO. ------------------------------------------------------------------------ [2002-08-17 00:58:09] kalowsky@php.net I believe this is a documented issue, and won't be fixed. ------------------------------------------------------------------------ [2002-08-16 15:56:02] six@aegis-corp.org There is a very fast way of testing, create a script called phpinfo.php with juste <?phpinfo()?> in it. Then call it like http://yourserver.com/phpinfo.php/this/is/a/test if the two images (zend and php logos) are broken, then $PHP_SELF is not set as it should be. again, this problem only happens with the CGI sapi ------------------------------------------------------------------------ [2002-08-16 15:44:07] kalowsky@php.net Okay can we have a sample script just to ensure that we may or may not have fixed your issue? ------------------------------------------------------------------------ [2002-08-16 13:48:35] six@aegis-corp.org I checked and this bug revives #14307 which died some time ago unfixed. The code in question is in sapi/cgi/cgi_main.c : SG(request_info).request_uri = getenv("PATH_INFO"); if (!SG(request_info).request_uri) { SG(request_info).request_uri = getenv("SCRIPT_NAME"); } Should be more like : SG(request_info).request_uri = getenv("SCRIPT_NAME"); strcat(SG(request_info).request_uri, getenv("PATH_INFO")); ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/18942 -- Edit this bug report at http://bugs.php.net/?id=18942&edit=1

« previous php.bugs (#17121) next »