php.net |  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
Votes:13
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 (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 5.2.4 OS: WinXP/IIS 5.1
Private report: No CVE-ID: None
 [2007-09-02 23:25 UTC] tkeese at yahoo dot com
Description:
------------
Path appears to be duplicated.

echo $_SERVER['PHP_SELF'];

Output:
/baseapp/myapp/progs/p.php/baseapp/myapp/progs/p.php

Expected:
/baseapp/myapp/progs/p.php


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-03 08:20 UTC] jani@php.net
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
Hello,
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:

http://bugs.php.net/bug.php?id=31892
http://bugs.php.net/bug.php?id=42198
 [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] jani@php.net
Dmitry, can you check this out? It seems to happen only within Windows/IIS..
 [2007-09-05 08:29 UTC] dmitry@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC