Bug #55076 [Csd->ReO]: requires() fails in a subdirectory with the in-built webserver
| From: | sixd@php.net | Date: | Tue, 05 Jul 2011 22:42:50 +0000 |
| Subject: | Bug #55076 [Csd->ReO]: requires() fails in a subdirectory with the in-built webserver | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-161620@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55076&edit=1
ID: 55076
Updated by: sixd@php.net
Reported by: sixd@php.net
Summary: requires() fails in a subdirectory with the in-built
webserver
-Status: Closed
+Status: Re-Opened
Type: Bug
Package: Built-in web server
Operating System: Linux
PHP Version: 5.4SVN-2011-06-29 (SVN)
Assigned To: moriyoshi
Block user comment: N
Private report: N
New Comment:
Still occurs anytime a relative path is used, e.g.
php -S localhost:8000 -t wstest
or
php -S localhost:8000 -t .
A workaround is to use an absolute path, e.g:
php -S localhost:8000 -t
pwd
Previous Comments:
------------------------------------------------------------------------
[2011-07-05 15:27:55] sixd@php.net
This no longer reproduces. It appears to have been fixed, most likely by the
change for https://bugs.php.net/bug.php?id=55118
in http://svn.php.net/viewvc?
view=revision&revision=312855
------------------------------------------------------------------------
[2011-06-29 17:51:44] sixd@php.net
The testcase files look like:
$ ls -lR wstest
wstest:
total 12
-rw-r--r-- 1 cjones cjones 318 2011-06-20 16:32 favicon.ico
-rw-r--r-- 1 cjones cjones 128 2011-06-29 14:33 index.html
drwxr-xr-x 2 cjones cjones 4096 2011-06-29 14:41 mydir
wstest/mydir:
total 8
-rw-r--r-- 1 cjones cjones 44 2011-06-29 14:28 foo.php
-rw-r--r-- 1 cjones cjones 75 2011-06-29 14:23 requiresfoo.php
$ cat wstest/index.html
<html>
<body bgcolor="#ffffff">
<a href="./mydir/requiresfoo.php" >Click here to load
mydir/requiresfoo.php</a>
</body>
</html>
$ cat wstest/mydir/requiresfoo.php
<?php
echo "In mydir/requiresfoo.php<br />\n";
require('./foo.php');
?>
$ cat wstest/mydir/foo.php
<?php
echo "In mydir/foo.php<br />\n";
?>
------------------------------------------------------------------------
[2011-06-29 17:47:21] sixd@php.net
Description:
------------
Working-directory handling in the in-built webserver differs from Apache. This
makes some non-trivial apps impossible to use in the CLI webserver.
Extract the testcase (attached as a patch).
$ tar -zxf wstest.tgz
$ cd wstest
$ php -n -S localhost:8000
In a browser, load http://localhost:8000/
The contents of index.html are displayed:
Click here to load mydir/requiresfoo.php
Click the link.
Test script:
---------------
See "patch" file
Expected result:
----------------
In mydir/requiresfoo.php
In mydir/foo.php
Actual result:
--------------
Warning: Unknown: failed to open stream: No such file or directory in Unknown on
line 0
Fatal error: Unknown: Failed opening required './mydir/requiresfoo.php'
(include_path='.:/home/cjones/php54-ic112/lib/php') in Unknown on line 0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55076&edit=1