Re: [SMARTY] unable to read template resource: "index.tpl" ... Smarty.class.phpon line 589
| From: | Dennis Gearon | Date: | Fri, 20 Dec 2002 01:17:01 +0000 |
| Subject: | Re: [SMARTY] unable to read template resource: "index.tpl" ... Smarty.class.phpon line 589 | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6900@lists.php.net to get a copy of this message | ||
I modified the Smarty.class.php file to give the REAL line number causing the problem, (and not
the line of error reporting fucntion :-( and it's line 1065. Anyone familiar with the inner
workings to be able to say what it means when it fails there?
This is the error properly reported, and the site paths NOW CHANGED and obscured below:
$smarty->template_dir /home/sitename/smartypath/smarty/templates/
$smarty->compile_dir /home/sitename/smartypath/smarty/templates_c/
$smarty->config_dir /home/sitename/smartypath/smarty/configs/
$smarty->cache_dir /home/sitename/smartypath/smarty/cache/
file opend fine
Warning: Smarty error: AT LINE->1065->IN
FILE->/home/sitename/smartypath/smarty/Smarty.class.php unable to read template resource:
"index.tpl" in /homesitename/smartypath/smarty/smarty/Smarty.class.phpon line 589
12/19/2002 4:46:26 PM, Dennis Gearon <gearond@cvc.net> wrote:
>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??????????????????????
>
>
>
>
>
>--
>Smarty General Mailing List (http://smarty.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>