|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-10-17 07:59 UTC] paul dot a dot norman at gmail dot com
Description: ------------ If the php internal server is launched using php -S localhost:8001 -t /myPath server_process.php 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 http://gluescript.sourceforge.net/ http://gtk.php.net/ or simillar for local wxWdiget dialogues called as necessary from php http://php.net/manual/en/function.system.php and an almost complete powerful solution is available. Paul Patchesphp_cli_server_add_docroot_to_include_path (last revision 2012-03-04 18:01 UTC by stuart at 3ft9 dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
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: ie: $ 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 ;-) Thanks. reezeYou don't need a new flag. php -B ini_set('include_path', get_include_path() . PATH_SEPARATOR . '/myPath') NOTE: Never used -B, so maybe you need "" around it or whatever, but you get the point.