PDA

View Full Version : how to set include path properly to use Smarty templates?



ElysianEagle
03-15-2009, 09:56 PM
hi,

i am trying to use smarty templates with my site. i created a directory named "Smarty" directly under my home directory, which is "/home/freespe1". inside that smarty directory i put all the smarty stuff. i am having a problem with the file /home/freespe1/Smarty/libs/Smarty.class.php.

my php.ini file is /home/freespe1/public_html/php.ini

i am using PHP5 with FastCGI. i modified the include_path so that it is now:

include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/freespe1/Smarty"

i have an index.php file, which has the following line in it:

require("libs/Smarty.class.php");

however, when i access that file over the web, i get the error that the require statement failed. from the error log, here is the message:

Failed opening required 'libs/Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/freespe1/public_html/index.php on line 3

how do i fix this? thanks!

shadmego
03-16-2009, 08:24 AM
You can try two things:

1: in your php.ini file:


include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/account/Smarty/lib"


2: in your index.php file:


require("/home/account/Smarty/lib/Smarty.class.php");


I don't know which one will work better for you ...

By the way, I would get rid of your actual account name in your post. No need to give your account name away ...

~regards, and welcome to the community