php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45637 PHP_SELF duplicate path
Submitted: 2008-07-27 08:55 UTC Modified: 2008-08-18 11:16 UTC
Votes:7
Avg. Score:4.1 ± 1.0
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:2 (33.3%)
From: djbass at dsm dot id dot au Assigned: dmitry (profile)
Status: Wont fix Package: CGI/CLI related
PHP Version: 5.2CVS-2008-07-27 (snap) OS: WinVista/Abyss X1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-07-27 08:55 UTC] djbass at dsm dot id dot au
Description:
------------
Path output via PHP_SELF is duplicated.

Appears to be same as http://bugs.php.net/bug.php?id=42523 but still occuring in latest CVS Snapshot.

Running on Windows Vista with Abyss Web Server X1.

Reproduce code:
---------------
echo $_SERVER['PHP_SELF'];

Expected result:
----------------
/joomla/index.php

Actual result:
--------------
/joomla/index.php/joomla/index.php

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-27 10:20 UTC] djbass at dsm dot id dot au
Can you be more specific as to what information you feel is missing.

I originally read the how-to for reporting and looked at previous bug reports as a guideline.

Nothing complex is required to reproduce the bug.

I have various PHP scripts running under a locally installed web server (http://localhost).

Until recently I had not had any specific problems until I tried to do a new Joomla install. It always errored out with a 500 Internal Server Error.

I traced the problem to a line of code containing $_SERVER['PHP_SELF'];

When I output the variable it always contains a duplicate path of itself. Eg:

http://localhost/apc/test.php

Produces:
/apc/test.php/apc/test.php


http://localhost/joomla/index.php

Produces:
/joomla/index.php/joomla/index.php
 [2008-07-27 11:08 UTC] jani@php.net
More like how you have configured PHP. INI options specific to CGI, etc.
 [2008-07-27 11:10 UTC] jani@php.net
Please try using Apache instead. I can't reproduce this problem with Apache and latest 5.2 snapshot.
 [2008-07-27 13:38 UTC] djbass at dsm dot id dot au
I tried with Apache 2.2.9 and latest snapshot and the problem does not seem to be apparent under that environment.

It is worth noting that under Apache PHP is being used as a module wheras Abyss X1 (http://www.aprelium.com/abyssws/download.php) is using php-cgi.exe

Given there are hundreds of INI options and it is unclear to me which relate specifically to CGI you'll have to tell me which ones you need info on.

All I can tell you is that it is a stock install of PHP 5.2.7-dev with the PHP_CURL, PHP_GD2 & PHP_MYSQL extensions loaded.
 [2008-07-27 13:58 UTC] jani@php.net
Those relevant ini options have 'cgi' in them. Try search for 'cgi' in your php.ini. And the stock php.ini-dist has quite good explanations for them too. How about you try actually with CGI under Apache, this bug was in CGI binary ONLY. Also, make sure you do not have ANY old dlls, exes, etc. from the old installation before you install the snapshot version. You also have to shutdown your webserver first..
 [2008-07-27 16:44 UTC] djbass at dsm dot id dot au
Tried running PHP as CGI in Apache this time using the exact same PHP install as I am using for Abyss.

Once again the problem did not occur, just seems to be something about non Apache installations.

cgi.check_shebang_line: 1
cgi.fix_pathinfo: 1 
cgi.force_redirect: 1
cgi.nph: 0
cgi.redirect_status_env: no value
cgi.rfc2616_headers: 0
fastcgi.impersonate: 0
fastcgi.logging: 1
 [2008-08-08 18:18 UTC] jani@php.net
Dmitry, another (badly?) behaving web server. Maybe that fix should be something more general..
 [2008-08-18 11:16 UTC] dmitry@php.net
This is known issue.

Abyss web server doesn't pass proper values for all CGI environment variables to PHP process (as Apache and IIS do) and as result PHP_SELF get invalid value.

I assue it is a Abyss failure and I don't like to fix it in PHP as the fix may cause failures for "proper" web servers. 

I'm ready to work with someone from Abyss tream to identify the failure.
 [2011-10-05 01:47 UTC] webmaster at estrategiasi dot com dot ar
This problem is not only with Abyss, I have the same bug with Windows 2003 / IIS 6.0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 17:01:31 2024 UTC