Forum Moderators: coopster
I have my.html page located in ../html_public/ Dir /SubDir/. That page calls my includeme.php file. I know that I can place “includeme.php” in SubDir and everything will work fine, however because the way I want to organize my files/directories I don’t want to put it there. That same “includeme.php” file is called by other html pages that are in different directories and subdirectories, hence I would like to put it in some centralized location (maybe ../html_public/myscripts/ or something to that effect).
Now if I put the “includeme.php” in the centralized location, and if I call it from my.html page, what is the best way to do this, i.e. least performance penalty for loading the my.html page?
Would it be:
include "../../../includeme.php";
or
include “mydomain.com/myscripts/includeme.php”;
or
configuring php.ini file (exactly what and how; also would I have to include the php.ini file in all dirs where .php files reside)
or
?
Thanks a lot
php_value include_path ".:/full/path/to/folder/html_public/myscripts/"
Now, PHP will always look in the local folder first. Then, if not found, look in your myscripts folder.
You can even, if you want, remove the initial ".:" portion to completely disallow includes in the local folder.
# File modified on Tue Feb 14 16:07:42 2006 by server
# For security reasons, mod_php is not used on this server. Use a php.ini file for php directives
# php_value include_path ".:/this/was/full/path/"
any other suggestions?
Bummer. Luckily though, this particular directive can be overridden per script. It isn't the ideal setup, but when you are using shared hosting that is just how it is.
ini_set() [php.net]
Be sure to follow the link to the 'appendix' on that page as well, you'll need to refer to this page of the manual more often than you would imagine.