#46366 [Asn->Csd]: bad cwd with / as pathinfo
| From: | dmitry@php.net | Date: | Fri, 28 Nov 2008 11:57:31 +0000 |
| Subject: | #46366 [Asn->Csd]: bad cwd with / as pathinfo | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131436@lists.php.net to get a copy of this message | ||
ID: 46366
Updated by: dmitry@php.net
Reported By: courtois at nouvo dot com
-Status: Assigned
+Status: Closed
Bug Type: CGI related
Operating System: windows XP
PHP Version: 5.2CVS-2008-10-24
Assigned To: dmitry
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2008-10-25 14:53:34] courtois at nouvo dot com
when cgi.fix_pathinfo=0
I get "No input file specified." for
http://localhost/foo/bar.php/ and
http://localhost/foo/bar.php/x
works for
http://localhost/foo/bar.php
------------------------------------------------------------------------
[2008-10-25 09:53:23] jani@php.net
What if you don't set this in your php.ini:
cgi.fix_pathinfo=1
(or set it to 0)
------------------------------------------------------------------------
[2008-10-25 04:52:05] courtois at nouvo dot com
I tested PHP Version 5.2.7RC2-dev (2008-Oct-24 20:00:00)
with the thread safe version the problem is the same.
with the non thread safe version I get:
No input file specified.
with both versions calling the script without pathinfo or with a
pathinfo other than / is still ok
------------------------------------------------------------------------
[2008-10-22 16:07:58] courtois at nouvo dot com
Description:
------------
when / is passed as pathinfo to a script current working directory is
set to the php-cgi.exe directory instead of script directory
http://localhost/foo/bar.php gives:
cwd===>C:\Program Files\Apache Group\Apache2\htdocs\foo<=== which is
ok
http://localhost/foo/bar.php/x gives:
cwd===>C:\Program Files\Apache Group\Apache2\htdocs\foo<=== which is
ok
http://localhost/foo/bar.php/ gives:
cwd===>C:\Program Files\PHP<=== which is obviously not ok, therefore
all includes in scripts fail
apache 2 config:
ScriptAlias /php/ "C:/Program Files/PHP/"
Action application/x-httpd-php "/php/php-cgi.exe"
php.ini:
cgi.fix_pathinfo=1
Reproduce code:
---------------
<?php
print "cwd===>".getcwd()."<===";
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46366&edit=1