note 40677 deleted from function.realpath by betz
| From: | betz@php.net | Date: | Thu, 11 Mar 2004 10:41:52 +0000 |
| Subject: | note 40677 deleted from function.realpath by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66616@lists.php.net to get a copy of this message | ||
Note Submitter: gordon_e_rouse@yahoo.com.au
----
I found this with console scripts, where you run from an alias to a full path, the function
realpath("./") seems to return the path to where your php script is sitting, and not where
you are currently working from.
(might be version dependant as this was occurring on debian using php 4.1.2 but not on redhat using
php4.3.3 )
In order to get the directory base which you are currently in, I found this a good work around.
$base = shell_exec( "pwd" );