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; } } ?> Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/ Share on other sites More sharing options...
BlueSkyIS Posted March 30, 2008 Share Posted March 30, 2008 does ./lib/smarty/Smarty.class.php exist? Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/#findComment-505052 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. Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/#findComment-505065 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 Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/#findComment-505070 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. Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/#findComment-505098 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 Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/#findComment-505100 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. Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/#findComment-505113 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); Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/#findComment-505143 Share on other sites More sharing options...
xXx_Hobbes_xXx Posted March 31, 2008 Author Share Posted March 31, 2008 aw...hamburgers Link to comment https://forums.phpfreaks.com/topic/98687-smartyclassphp-error/#findComment-505247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.