xXx_Hobbes_xXx Posted March 30, 2008 Share Posted March 30, 2008 I'm receiving this error on a project and it's confusing me: Warning: require_once(./lib/smarty/Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in C:\tshirtshop\presentation\application.php on line 3 Fatal error: require_once() [function.require]: Failed opening required './lib/smarty/Smarty.class.php' (include_path='.;C:\xampp\php\pear\') in C:\tshirtshop\presentation\application.php on line 3 Here's the application.php: What am I not typing correctly? <?php // Reference Smarty library require_once SMARTY_DIR . 'Smarty.class.php'; /* Class that extends Smarty, used to process and display Smarty files */ class Application extends Smarty { // Class constructor public function _construct() { // Call Smarty's constructor parent::Smarty(); // Change the default template directories $this->template_dir = TEMPLATE_DIR; $this->compile_dir = COMPILE_DIR; $this->config_dir = CONFIG_DIR; } } ?> Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted March 30, 2008 Share Posted March 30, 2008 does ./lib/smarty/Smarty.class.php exist? Quote Link to comment Share on other sites More sharing options...
xXx_Hobbes_xXx Posted March 30, 2008 Author Share Posted March 30, 2008 http://i19.photobucket.com/albums/b187/prs82/desktop.jpg Yep, it's there alright. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted March 30, 2008 Share Posted March 30, 2008 it's there, yes, but not in relation to your script, which is located here: C:\tshirtshop\presentation\application.php if you're going to run the script there, you'll need to change SMARTY_DIR to ../../lib/smarty/ or move your script to C:\tshirtshop\application.php Quote Link to comment Share on other sites More sharing options...
xXx_Hobbes_xXx Posted March 30, 2008 Author Share Posted March 30, 2008 I'm sorry, but how do I change SMARTY_DIR to ../../lib/smarty/ ? I tried the other alternative, moving the application.php to my root folder, but that didn't help. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted March 30, 2008 Share Posted March 30, 2008 it is already declared somewhere in your code. look for define(SMARTY_DIR somewhere else, try redefining it like: define(SMARTY_DIR, '../../lib/smarty/'); before your require_once Quote Link to comment Share on other sites More sharing options...
xXx_Hobbes_xXx Posted March 30, 2008 Author Share Posted March 30, 2008 Okay, I found the code in my config.php file. The code for my config.php now looks like this: // Settings needed to configure the Smarty template engine define('SMARTY_DIR', SITE_ROOT . '../../lib/smarty/'); define('TEMPLATE_DIR', PRESENTATION_DIR . 'templates'); define('COMPILE_DIR', PRESENTATION_DIR . 'templates_c'); define('CONFIG_DIR', SITE_ROOT . '/include/configs'); But it's still telling me the same thing, only now with the '../..' added on. Quote Link to comment Share on other sites More sharing options...
xXx_Hobbes_xXx Posted March 30, 2008 Author Share Posted March 30, 2008 haha, i was missing the 's' on llibs' folder. Okay, yet another problem. Now I see: Warning: Smarty error: unable to read resource: "store_front.tpl" in C:\tshirtshop\libs\smarty\Smarty.class.php on line 1092 If I'm understanding this correctly, it can't read the template I have stored when it approaches the 1092nd line of my php code, which reads trigger_error("Smarty error: $error_msg", $error_type); Quote Link to comment Share on other sites More sharing options...
xXx_Hobbes_xXx Posted March 31, 2008 Author Share Posted March 31, 2008 aw...hamburgers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.