For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > February 2005 > Re: [SMARTY] unable to read resource









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] unable to read resource
Zuhaimi Zainal

2005-02-23, 4:00 am

try this
$smarty->template_dir = '/var/www/smartytest/templates/';
or
$smarty->display('/index.tpl');


On Tue, 22 Feb 2005 19:56:55 +0100, Tobias Daur <daur@gmx.de> wrote:
> Hi,
>
> I'm stuck - hope, someone can help me.
> I use smarty now for several projects on several servers, it's working
> fine everywhere. Since upgrading my dev laptop to debian sarge (which
> means: changing php to 4.3.10, apache to 1.3.3), Smarty doesn't find the
> templates anymore.
>
> Smarty: 2.6.6
>
> I went down to this peace of code:
>
> <?php
> require('libs/Smarty.class.php');
> $smarty = new Smarty;
> $smarty->template_dir = '/var/www/smartytest/templates';
> $smarty->debugging = true;
> $smarty->debug_tpl = 'debug.tpl';
> $smarty->display('index.tpl');
> ?>
>
> I get:
> Warning: Smarty error: unable to read resource: "index.tpl"
> in /var/www/smartytest/libs/Smarty.class.php on line 1088
>
> The dir and filename is correct, rights are correct, php safe_mode is
> off.
>
> It however works with
>
> $smarty->display("/var/www/smartytest/templates/index.tpl");
> and also with
> $smarty->display($smarty->template_dir."/index.tpl");
>
> Why doesn't it work here with
> $smarty->display('index.tpl');
> but works on every other server i tried with this sample?
>
> thanks
>
> Tobias
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com