|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28109 CGI mode: $PHP_SELF incorrect
Submitted: 2004-04-22 17:05 UTC Modified: 2004-04-22 18:35 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: bertrand at linkeo dot com Assigned:
Status: Closed Package: CGI/CLI related
PHP Version: 4.3.4 OS: GNU/Linux Debian
Private report: No CVE-ID: None
 [2004-04-22 17:05 UTC] bertrand at linkeo dot com
While used in CGI mode, $PHP_SELF seems not to be set to the correct value:

_SERVER["PHP_SELF"] => /var/www/vhs-testsuite/bar.tld/foo.php

I also noticed this:

SCRIPT_NAME => /foo.php
_SERVER["SCRIPT_NAME"] => /var/www/vhs-testsuite/bar.tld/foo.php
_ENV["SCRIPT_NAME"] => /foo.php

_SERVER["SCRIPT_NAME"] seems not to follow the environment variables data.

Bug described here:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-22 18:23 UTC] bertrand dot lupart at linkeo dot com
Tried with 4.3.6, and it seems solved while it isn't mentioned in the Changelog.
 [2004-04-22 18:35 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 07:01:23 2021 UTC