Jump to content

Smarty.class.php error


xXx_Hobbes_xXx

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.