note 15236 modified in function.include by jeroen
| From: | jeroen@php.net | Date: | Sun, 02 Sep 2001 19:34:18 +0000 |
| Subject: | note 15236 modified in function.include by jeroen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17545@lists.php.net to get a copy of this message | ||
Some of these comments make includes seem quite messy and difficult. This is not the case...
Options do and have existed, at least for php4 users, to make a->b->c includes quite painless.
You can absolute path everything with $DOCUMENT_ROOT
or
Change the include directory in php.ini
or
For virtual hosted sites with apache, add
php_value include_dir ".:/path1:/path/two"
inside your <VirtualHost> or <Directory> tags...
[Editor's note: You can even add a 'php_value include_dir
".:/path1:/path/two"' in your .htaccess file, so this solution is also available if
you don't have control over the server
--jeroen]
All these options make includes extremely simple.
If you define paths, a simple
include("whatever.inc") will search all the paths, in order, for whatever.inc
http://www.php.net/manual/en/function.include.php