View previous topic :: View next topic |
Author |
Message |
nonamer Smarty n00b
Joined: 15 Mar 2006 Posts: 3
|
Posted: Wed Mar 15, 2006 8:51 pm Post subject: Smarty error: unable to read resource: "index.tpl" |
|
|
I have followed the quick install instructions exactly but am getting the following error message:
"Warning: Smarty error: unable to read resource: "index.tpl" in /home/myusername/public_html/lib/php/Smarty/Smarty.class.php on line 1095"
I have read through several posts on this board but, unless I am missing something, I cannot find a resolution for it so I am hoping somone on these boards can help.
My server is running PHP 4.4.1 standard and Cpanel 10.8.1-RELEASE 113
My index.php file looks like
Code: |
<?php
// put full path to Smarty.class.php
require('/home/dnb/public_html/lib/php/Smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = '/home/myusername/public_html/www.mydomainname.com/smarty/templates';
$smarty->compile_dir = '/home/myusername/public_html/www.mydomainname.com/smarty/templates_c';
$smarty->cache_dir = '/home/myusername/public_html/www.mydomainname.com/smarty/cache';
$smarty->config_dir = '/home/myusername/public_html/www.mydomainname.com/smarty/configs';
$smarty->assign('name', 'Ned');
$smarty->display('index.tpl');
?>
|
I checked the troubleshooting section in Chapter 17 and everything seems to check out. The "index.tpl" file is in the smarty/templates/ directory as it should be.
I am a newbie to PHP. Any help would be greatly appreciated. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
|
Back to top |
|
nonamer Smarty n00b
Joined: 15 Mar 2006 Posts: 3
|
Posted: Wed Mar 15, 2006 9:02 pm Post subject: |
|
|
Actually, I didn't. I wanted to hide the username in my original post. It is correct in every line in the index.php file. Thanks for the link. |
|
Back to top |
|
nonamer Smarty n00b
Joined: 15 Mar 2006 Posts: 3
|
Posted: Wed Mar 15, 2006 9:10 pm Post subject: |
|
|
Thanks again. I figured out the problem. Just to clarify how, I had to edit the index.php file to look like:
Code: | <?php
// put full path to Smarty.class.php
require('/home/dnb/public_html/lib/php/Smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = '../smarty/templates';
$smarty->compile_dir = ../smarty/templates_c';
$smarty->cache_dir = '../smarty/cache';
$smarty->config_dir = '../smarty/configs';
$smarty->assign('name', 'Ned');
$smarty->display('index.tpl');
?>
|
|
|
Back to top |
|
imadeel Smarty n00b
Joined: 20 Dec 2006 Posts: 1
|
Posted: Wed Dec 20, 2006 1:27 am Post subject: |
|
|
Simple Answer which i discovered is create a configs and put your configuration file inside it and you can refer the configuration file anytime and smarty will grab it from there.
|
|
Back to top |
|
c_domain Smarty n00b
Joined: 19 Jan 2008 Posts: 1
|
Posted: Sat Jan 19, 2008 5:14 pm Post subject: Hi nonamer, I am still getting the same error |
|
|
Wats Wrong in my index.php file as below
---------0000----
DEFINE ('AREA', 'C');
DEFINE ('AREA_NAME' ,'customer');
require './prepare.php';
if (!empty($html_catalog)) {
define ('NO_SESSION', true);
}
require './init.php';
if (!empty($settings['General']['store_access_key'])) {
sess_register('store_access_key');
if (!empty($_GET['store_access_key'])) {
$store_access_key = $_GET['store_access_key'];
}
if ($store_access_key != $settings['General']['store_access_key']) {
fn_redirect('store_closed.html');
}
}
// Converting script vars to use in HTML catalog
if (!empty($html_catalog)) {
$index_script = $cscart_host_dir . '/' . $customer_index;
$image_index = $cscart_host_dir . '/' . $image_index;
// Disable ajax actions during html catalog generation
$settings['DHTML']['customer_ajax_based_pagination'] = 'N';
$settings['DHTML']['ajax_add_to_cart'] = 'N';
$settings['DHTML']['ajax_comparison_list'] = 'N';
$smarty->assign('image_index', $image_index);
} else {
$index_script = $customer_index;
}
$smarty->assign('index_script', $index_script);
//
// Common includes
//
include $common_dir.'customer_common.php';
fn_add_breadcrumb(fn_get_lang_var('home'), $index_script);
if (empty($target)) {
$target = 'index';
}
//
// Include target script from $script_targets array
//
if (file_exists(@$script_targets[$target])) {
include $script_targets[$target];
} else {
fn_set_exception('no_page');
}
if (!empty($_GET['ajax'])) {
fn_show_template('content.tpl', $smarty, false, $_GET['ajax'], true);
} else {
fn_show_template('index.tpl',$smarty, true);
}
?>
Thanks in advance |
|
Back to top |
|
koejkje Smarty Rookie
Joined: 27 Nov 2003 Posts: 30 Location: Miami, Florida
|
Posted: Mon Mar 24, 2008 3:18 pm Post subject: |
|
|
What is the solution to this I have the same exact problem error line :
[24-Mar-2008 10:14:49] PHP Warning: Smarty error: unable to read resource: "search_box" in /usr/local/apache2/htdocs/domain.com/web/smarty/Smarty.class.php on line 1144 _________________ R. Stacy Cook
Edit-X :: Control Your Content
www.edit-x.com |
|
Back to top |
|
sbhar Smarty n00b
Joined: 03 Aug 2009 Posts: 1
|
Posted: Mon Aug 03, 2009 5:49 am Post subject: try this |
|
|
Code: |
<?php
require_once('c:/phpdev/www/lib/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = 'guestbook/templates/';
$smarty->compile_dir = 'guestbook/templates_c/';
$smarty->config_dir = 'guestbook/configs/';
$smarty->cache_dir = 'guestbook/cache/';
$smarty->assign('name','Ned');
//** un-comment the following line to show the debug console
$smarty->debugging = true;
$smarty->display('index.tpl');
?>
|
|
|
Back to top |
|
genroxbro Smarty Rookie
Joined: 29 Jul 2009 Posts: 6 Location: Canada
|
Posted: Fri Aug 07, 2009 6:38 pm Post subject: Smarty error unable to read resource "index tpl" |
|
|
Hi There
Im having the above error. When I accessed joomla through my browser for the first time it asked me to remove the installation files I thought that happened after the installation was complete? when I deleted the installation folder I get "Database Error: Unable to connect to the database:Could not connect to MySQL" I created the database on my remote server but Im new to Mysql. My admin panel allows me to import tables. is that an option... otherwise Im stumped?
Any help greatly appreciated
James
p.s. my host is UKcheapest
_____________________________________
Website I designed for payday loan company. |
|
Back to top |
|
|