Forum Moderators: coopster
I have installed php environment using PHPTRAID. my smarty folder resides in
Code:
C:/apache/htdocs/smarty
when i browse
Code:
[localhost...]
it doesn't give me any error. I have a page that tries to include smarty, this page resides in
Code:
C:/apache/htdocs/project/lib.inc.php
here is the code i am using,
# Filename: libs.inc.php
PHP Code:
# the exact path is defined.
$fixpath = dirname(__FILE__);
# changes this value according to your uploaded smarty distribution.
# don't forget to add trailing back slash
# change 'username' to your username on web hosting account
define ("SMARTY_DIR", "localhost/root/smarty/");
require_once (SMARTY_DIR."Smarty.class.php");
$smarty = new Smarty;
$smarty->compile_dir = "$fixpath/compile";
$smarty->template_dir = "$fixpath/html";
i have picked this code from a Smarty Tutorial.
but this code displays error,
Code:
Fatal error: Failed opening required '/root/smarty/Smarty.class.php'
(include_path='.;c:\apache\htdocs\opm\include;c:\apache\htdocs\ezt\include;C:/apache/htdocs/project')
in c:\apache\htdocs\project\libs.inc.php on line 13
i also tried
ini_set("include_path",
ini_get("include_path") . "C:/apache/htdocs/smarty");
ini_set("include_path",
ini_get("include_path") . "http://localhost/smarty");
but nothing is working and am getting the same error.
i have some doubt in tutorial where he uses USERNAME like,
PHP Code:
define ("SMARTY_DIR", "localhost/root/smarty/");
please guide me in solving this problem.