|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2002-12-28 22:05 UTC] undream at yifan dot net
 A call to http://localhost/env.php with env.php containing a phpinfo() call returns this for $_SERVER['PHP_SELF'] = ocs/env.php I have no idea what 'ocs' is. This is run on a Konqueror 3.1 browser. PHP is ran as CGI. Previous php (4.2.3) compiled using the _exact_ same setup gives the correct info (localhost/env.php) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 05:00:02 2025 UTC | 
Same for me, your patch seems to have no affect. I checked the debugging output from cgiwrap which says: [...] Fixing Environment Variables. Environment Variables: QUERY_STRING: '' SCRIPT_NAME: '/phpinfo.php' SCRIPT_FILENAME: '<DOCUMENT_ROOT>/phpinfo.php' REDIRECT_URL: '<NULL>' PATH_INFO: '/phpinfo.php' PATH_TRANSLATED: '<DOCUMENT_ROOT>/phpinfo.php' REMOTE_USER: '<NULL>' REMOTE_HOST: '<NULL>' REMOTE_ADDR: '217.4.137.70' [...] Seems to be ok?! But PHP_SELF has no value. On my localhost PHP 4.3/CGI works with cgiwrap. The same paragraph with this machine: [...] Fixing Environment Variables. Environment Variables: QUERY_STRING: '' SCRIPT_NAME: '/php/ phpinfo.phpI' SCRIPT_FILENAME: '<DOCUMENT_ROOT>/php/phpinfo.php' REDIRECT_URL: '' PATH_INFO: '/php/phpinfo.php' PATH_TRANSLATED: '<DOCUMENT_ROOT>/php/phpinfo.php' REMOTE_USER: '' REMOTE_HOST: '' REMOTE_ADDR: '192.168.23.2' [...] In this case, script_name is broken for some reason (don't ask me why, i didn't find out). But PHP_SELF has the correct value! On both server SCRIPT_NAME isn't listed in the phpinfo()-Output. Hope this will help.That (or similar) urgent problem occurs here too. PHP versions before mid december were not affected IMO. At first today I've checked out the "php4" and "php5" modules from CVS, configured, and build them. After installation of the CGI binaries I detected a problem with $_SERVER['PHP_SELF']: a) the PHP4 version shows "no value" b) the PHP5 version shows illegal characters, cut off strings with low ASCII values etc. Depending on the namebased vhost name the value of PHP_SELF looks like "ind##" instead of "index.php" ("#" should represent low ASCII chars, which are shown as boxes here) of just "5" which is definitely the last char of "index.php5". Short: looks like a pointer on a string array is bent somewhere. The problem insist with and without '--enable-force-cgi-redirect' in both versions. As an example you may want to take a look at http://daniel-gorski.de/index.php4 (PHP4 CGI) http://daniel-gorski.de/index.php5 (PHP5 CGI) and compare the values of $_SERVER['PHP_SELF']. Additionally the PHP5 version has a strange "Zend Extension" date: 90021012. OTOH this value seems to be correct in the PHP4 version. The operating system is Linux (RedHat 6.2). I would appreciate to see this bug solved as soon as possible, because this is a dramatic show stopper for a few ZE2 applications I am developing & running. What required information can I provide to help to solve this problem? regards dtgTilde expansion in URL has same problem on Solaris. I was able to use the provided workaround: $_SERVER['SCRIPT_NAME'] = substr($_SERVER['PATH_TRANSLATED'], strlen($_SERVER['DOCUMENT_ROOT'])); if (substr($_SERVER['SCRIPT_NAME'], 0, 2) == '//') { $_SERVER['SCRIPT_NAME'] = substr($_SERVER['SCRIPT_NAME'], 1); } to fix the same problem (invalid PHP_SELF) on Solaris 2.7 Sparc, PHP 4.3.0 (fresh). Simply doing phpinfo(); and then appending the value of PHP_SELF onto an 'ls ' statement yielded "no such file". The file did not exist: $ ls /~russ/tryseed/showSeed.phtml /~russ/tryseed/showSeed.phtml: No such file or directory What I can contribute here is this: I was running out of a "pubic_html" subdirectory off of ~russ (above), and the URL typed into IE 5.2 (Mac OS X) was: "http://hostname/~russ/tryseed/showSeed.html" --Thank you to whoever came up with that workaround above.