For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > February 2005 > 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 unable to read resource
Tobias Daur

2005-02-22, 4:02 pm

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
Sponsored Links







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

Copyright 2008 codecomments.com