|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42523 PHP_SELF duplicates path
Submitted: 2007-09-02 23:25 UTC Modified: 2007-09-05 08:29 UTC
Avg. Score:5.0 ± 0.0
Reproduced:10 of 10 (100.0%)
Same Version:10 (100.0%)
Same OS:5 (50.0%)
From: tkeese at yahoo dot com Assigned: dmitry
Status: Closed Package: CGI/CLI related
PHP Version: 5.2.4 OS: WinXP/IIS 5.1
Private report: No CVE-ID:
 [2007-09-02 23:25 UTC] tkeese at yahoo dot com
Path appears to be duplicated.

echo $_SERVER['PHP_SELF'];




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-03 08:20 UTC]
How have you configure PHP in IIS? What values do your cgi.* directives have? What query causes this?
 [2007-09-03 17:41 UTC] w dot ashcroft at redfoxuk dot com
Got the exact same problem here, using standard CGI with these settings:

cgi.fix_pathinfo = 1
cgi.force_redirect = 0
fastcgi.impersonate = 1

cgi.fix_pathinfo = 0 does not fix the problem.

Problem did not exist in 5.2.3 and is causing lots of headaches for our customers on our servers.
 [2007-09-03 17:44 UTC] tkeese at yahoo dot com
I am using the default CGI configuration from the Win32 installer. 

cgi.check_shebang_line	1	1
cgi.fix_pathinfo	0	0
cgi.force_redirect	0	0
cgi.nph	0	0
cgi.redirect_status_env	no value	no value
cgi.rfc2616_headers	0	0
fastcgi.impersonate	0	0
fastcgi.logging	1	1

From phpinfo() output (5.2.4):
_SERVER["PHP_SELF"]	/baseapp/test/p.php/baseapp/test/p.php

From phpinfo() output (5.2.3) using same configuration as above:
_SERVER["PHP_SELF"]	/baseapp/test/p.php
 [2007-09-03 17:49 UTC] w dot ashcroft at redfoxuk dot com
Looks like these bugfixes may have broken it:
 [2007-09-03 17:53 UTC] w dot ashcroft at redfoxuk dot com
...on another note DOCUMENT_ROOT is now being set correctly, it always used to be empty.
 [2007-09-04 03:37 UTC] w dot ashcroft at redfoxuk dot com
...does not happen using ISAPI.
 [2007-09-04 03:37 UTC] w dot ashcroft at redfox dot uk
(I mean this bug does not happen using ISAPI, only CGI)
 [2007-09-04 09:04 UTC] christoffer dot cena at braathe dot no
I can confirm this error on Windows Server 2003 using PHP 5.2.4 as CGI with IIS 6. Running phpinfo() in a file called /info.php shows that the PHP_SELF variable contains "/info.php/info.php.
 [2007-09-04 09:58 UTC]
Dmitry, can you check this out? It seems to happen only within Windows/IIS..
 [2007-09-05 08:29 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Thu Jan 19 21:01:46 2017 UTC