note 11859 deleted from function.require-once by rasmus
| From: | rasmus@php.net | Date: | Mon, 12 Aug 2002 14:20:40 +0000 |
| Subject: | note 11859 deleted from function.require-once by rasmus | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-34866@lists.php.net to get a copy of this message | ||
Unlike C #include, PHP's require() and require_once() don't handle relative paths
correctly. A relative path in these two functions is respective to the location of the
"topmost" script, but not to the location of the file where these functions placed. This
pretty much makes these functions useless. For functions include() and include_once() there is a
work-around -- realpath(). For instance:
include_once( realpath( '../include/common.inc' ) )