how to know the php include_path

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
everydayrun
Forum Commoner
Posts: 51
Joined: Wed Jan 20, 2010 1:30 am

how to know the php include_path

Post by everydayrun »

copy Smarty libs in one of the folders of the php include_path, don't know how to do this,because i don't know which folders in under the php include_path.any tips would be appreciated.
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: how to know the php include_path

Post by cpetercarter »

Code: Select all

echo get_include_path();
However, if you place the Smarty files in a directory within your website, and then define a constant SMARTY_DIR with the full system path to the Smarty files and with a trailing slash eg :

Code: Select all

define (SMARTY_DIR, "/home/myname/www/htdocs/mysite/inc/smarty/");
you can initialise Smarty with;

Code: Select all

require(SMARTY_DIR.'Smarty.class.php');
The stuff in the Smarty manual about putting the smarty files somewhere in the include path is really only for cases where you want one set of Smarty files on the server which can be used by all the websites on the server.
Post Reply