Edit report at https://bugs.php.net/bug.php?id=55076&edit=1

 ID:                 55076
 Updated by:         fel...@php.net
 Reported by:        s...@php.net
 Summary:            requires() fails in a subdirectory with the in-built
                     webserver
-Status:             Re-Opened
+Status:             Closed
 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:

This bug has been fixed in SVN.

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.

It should works now. :)


Previous Comments:
------------------------------------------------------------------------
[2011-07-05 21:54:54] fel...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=312974
Log: - Fixed bug #55076 (requires() fails in a subdirectory with the in-built 
webserver)

------------------------------------------------------------------------
[2011-07-05 18:42:49] s...@php.net

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`

------------------------------------------------------------------------
[2011-07-05 15:27:55] s...@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] s...@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] s...@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

Reply via email to