Smarty error: unable to read template resource
| From: | (Diarmid Sloan) | Date: | Fri, 08 Nov 2002 08:59:26 +0000 |
| Subject: | Smarty error: unable to read template resource | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6370@lists.php.net to get a copy of this message | ||
Hi,
I am trying to install Smarty on Windows 2000 Professional. I already have
a working Apache and PHP installation. However, when attempting to code my
own Smarty example or even use the existing example I keep getting the
following error:
Smarty error: unable to read template resource: "index.tpl" in
C:/apache/php/pear/Smarty/Smarty.class.php
on line 589
I have viewed loads of postings on this problem in various newsgroups but
they all make "suggestions" and no-one seems to indicate whether these
work or not. I have tried all of them but to no avail.
I have installed the Smarty directory under C:/apache/php/pear and added
C:\apache\php\pear\Smarty into the PHP include_path. However, judging by
the error the Smarty.class.php is being found ok so that isn't the problem.
My example is called test.php and lives in C:/apache/htdocs/SmartyExample
with the template index.tpl in the templates subdirectory.
The web browser can see the template ok, it's just that the class
seemingly can't. Most of the advice on newsgroups centres around checking
directory permissions on the templates directory and the templates_c
directory that I created. However, in Windows I have checked these and
they are read/write/executable. Is there more than meets the eye to
setting permissions on Windows directories? I thought these would be
read/write/executable by default. In the folder properties they are
accessible by "Everyone".
I have also tried defining the template (and other) directories within the
constructor of my extended Smarty class. I have tried using the absolute
path, ie. "file:C:/apache/htdocs/SmartyExample/templates/", defining the
path relative to the web server document root, ie.
"/SmartyExample/templates/" (with and without the trailing slash) and the
error just won't go away.
Any suggestions before I tear all my hair out!
Thanks,
Diarmid Sloan