#46366 [Fbk->Opn]: bad cwd with / as pathinfo
ID: 46366
User updated by: courtois at nouvo dot com
Reported By: courtois at nouvo dot com
-Status: Feedback
+Status: Open
Bug Type: CGI related
Operating System: windows XP
PHP Version: 5.2.6
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2008-10-23 12:10:26] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[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
Thread (7 messages)