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

 ID:                 55076
 Updated by:         s...@php.net
 Reported by:        s...@php.net
 Summary:            requires() fails in a subdirectory with the in-built
                     webserver
 Status:             Open
 Type:               Bug
 Package:            CGI related
 Operating System:   Linux
 PHP Version:        5.4SVN-2011-06-29 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

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";

?>


Previous Comments:
------------------------------------------------------------------------
[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