|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60075 using -t /myPath does not add /myPath to include_path
Submitted: 2011-10-17 07:59 UTC Modified: 2021-08-11 10:11 UTC
Avg. Score:3.4 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: paul dot a dot norman at gmail dot com Assigned: cmb (profile)
Status: Wont fix Package: Built-in web server
PHP Version: 5.4.0beta1 OS: Win32
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-10-17 07:59 UTC] paul dot a dot norman at gmail dot com
If the php internal server is launched using php -S localhost:8001 -t /myPath 

and server_process.php is in /myPath the following would result

Warning: Unknown: failed to open stream: No such file or directory in Unknown on 
line 0

Fatal error: Unknown: Failed opening required 'server_process.php' 
(include_path='.;C:\php\pear') in Unknown on line 0

Obviously using: ... -t /myPath /myPath/server_process.php
works as expected, 

but it would seem intuitive that when using: 

php -S localhost:8001 -t something

that "something" would be automatically added to the include_path ?

P.S. the php internal server is a brilliant addition, facilitates making virtual 
desktop applications in the browser a cinch! Allows the leveraging of browser 
technology jQuery and all the rest with php on the client -- very powerful!!!

Add in or simillar for 
local wxWdiget dialogues called as necessary from php and an almost complete powerful  
solution is available.



php_cli_server_add_docroot_to_include_path (last revision 2012-03-04 18:01 UTC by stuart at 3ft9 dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-04 18:04 UTC] stuart at 3ft9 dot com
This is my first patch so I may have missed something. This patch simply prepends 
the document root to include_path for each request.
 [2012-03-05 22:12 UTC]
-Assigned To: +Assigned To: moriyoshi
 [2012-03-08 05:09 UTC] reeze dot xia at gmail dot com
Hi, Stuart

    I think add doc-root to include_path may impact the behavior of your 
application, because this changes the include path of your application too. 
maybe some application didn't add docroot to it's include_path , but the server 
add it. (include require autoload etc.).

    if you just want to set router script easily, I don't think it deserve the 
change.  And this behavior different with the way we use cli tools:
$ ls -l file.php
just print the information of  $PWD's file.php but not some other folder's 
file.php. This is confusing

If we want to add include path maybe a new option like -I /new/include/path 
maybe useful.

so -1 for me ;-)

 [2012-03-13 15:13 UTC]
You don't need a new flag.

php -B ini_set('include_path', get_include_path() . PATH_SEPARATOR . '/myPath')

Never used -B, so maybe you need "" around it or whatever, but you get the point.
 [2016-12-01 13:52 UTC]
> but it would seem intuitive that when using: 
> php -S localhost:8001 -t something
> that "something" would be automatically added to the include_path ?

IMHO no, because I wouldn't put the router script in the docroot in the first place.
 [2017-10-24 06:33 UTC]
-Status: Assigned +Status: Open -Assigned To: moriyoshi +Assigned To:
 [2021-08-11 10:11 UTC]
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-08-11 10:11 UTC]
For the stated reasons, this is unlikely to be implemented, so I'm
closing the ticket as WONTFIX.  If anybody still thinks this would
be a good feature, please pursue the RFC process[1].

[1] <>
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 19:01:24 2023 UTC