unable to read template resource: "index.tpl" ... Smarty.class.phpon line 589
| From: | Dennis Gearon | Date: | Fri, 20 Dec 2002 00:46:26 +0000 |
| Subject: | unable to read template resource: "index.tpl" ... Smarty.class.phpon line 589 | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6899@lists.php.net to get a copy of this message | ||
I know it's got to be some sort of set up problem. But anyway, this is what I've got.
OS/SERVER/PHP/SMARTY VERSIONS
=====================================================================================
Linux Unknown (hosted)
apache_1.3.19
PHP Version 4.0.4pl1
Smarty 2.3.1 <<supposed to require 4.0.6 or greater PHP, is this the problem?>>
FILES
=====================================================================================
in prepend.php I have
----------------------
define( 'SMARTY_DIR', '/home/sitename/smarty/' );
in http://www.sitename.tld/test_smarty.php I
have
-----------------------------------------------
<?php
require(SMARTY_DIR . 'Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = SMARTY_DIR . 'templates/';
$smarty->compile_dir = SMARTY_DIR . 'templates_c/';
$smarty->config_dir = SMARTY_DIR . 'configs/';
$smarty->cache_dir = SMARTY_DIR . 'cache/';
echo "\$smarty->template_dir " .
$smarty->template_dir . "<br>\n";
echo "\$smarty->compile_dir " .
$smarty->compile_dir . "<br>\n";
echo "\$smarty->config_dir " .
$smarty->config_dir . "<br>\n";
echo "\$smarty->cache_dir " .
$smarty->cache_dir . "<br>\n";
$smarty->use_sub_dirs = FALSE;
$fp = fopen ($smarty->template_dir . 'index.tpl', "r");
if( FALSE != $fp ){
echo "file opend fine<br>\n";
fclose( $fp );
}
else echo "file NOT OPENED<br>\n";
$smarty->assign('name','Ned');
$smarty->display('index.tpl');
?>
PERMISSIONS
=====================================================================================
I have permissons set for all directories down to ../smarty/ set to 711.
I (temporarily) have permissons set for ../smarty/cache/ set to 777.
I (temporarily) have permissons set for ../smarty/templates_c/ set to 777.
OUTPUT/ERROR
=====================================================================================
$smarty->template_dir /home/sitename/smarty/templates/
$smarty->compile_dir /home/sitename/smarty/templates_c/
$smarty->config_dir /home/sitename/smarty/configs/
$smarty->cache_dir /home/sitename/smarty/cache/
file opend fine
Warning: Smarty error: unable to read template resource: "index.tpl" in /home/oregonal-
anon/rsrcs/php/libs/others/smarty/Smarty.class.phpon line 589
FURTHER
=====================================================================================
if I mess around with different slashes on the end of ../templates_c/ etcetera, the script
fails with an 'fopen' error on line 15 of Smarty.class.php, so the permissions and path
have to
be right if I am not getting that error.
REQUESTS
=====================================================================================
ANY HINTS??????????????????????