note 93383 added to features.commandline
| From: | Wade at osu1 dot php dot net | Date: | Mon, 07 Sep 2009 05:46:53 +0000 |
| Subject: | note 93383 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160270@lists.php.net to get a copy of this message | ||
I've just found that the fact that the CLI does *not* change the current directory will make
include() and require() calls with relative paths fail. This is because they are relative to the
current directory, not to the current executing file, the documentation notwithstanding. In CGI
mode, this is the same because it changes the current directory.
One solution is to call the CGI binary rather than the CLI one. A better solutions is to use
dirname(__FILE__) in your path names.
----
Server IP: 69.147.83.197
Probable Submitter: 203.26.177.2
----
Manual Page -- http://www.php.net/manual/en/features.commandline.php
Edit -- https://master.php.net/note/edit/93383
Del: integrated -- https://master.php.net/note/delete/93383/integrated
Del: useless -- https://master.php.net/note/delete/93383/useless
Del: bad code -- https://master.php.net/note/delete/93383/bad+code
Del: spam -- https://master.php.net/note/delete/93383/spam
Del: non-english -- https://master.php.net/note/delete/93383/non-english
Del: in docs -- https://master.php.net/note/delete/93383/in+docs
Del: other reasons-- https://master.php.net/note/delete/93383
Reject -- https://master.php.net/note/reject/93383
Search -- https://master.php.net/manage/user-notes.php