Page 1 of 1

how to know the php include_path

Posted: Thu Jul 15, 2010 10:10 pm
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.

Re: how to know the php include_path

Posted: Fri Jul 16, 2010 12:44 am
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.