|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
dave Smarty n00b
Joined: 06 Oct 2004 Posts: 4
|
Posted: Wed Oct 06, 2004 4:34 pm Post subject: unable to read template |
|
|
Hi there,
I hope you can help me. It probably is just a simple mistake of mine but I don't have much experience and running out of ideas.
I have installed and copied my locally functioning Smarty 2.6.2 website on my rented webspace and got the following error when I tried to access my index page.
Code: | Warning: Smarty error: unable to read resource: "index.tpl.html" in /www/htdocs/trailhun/smarty/Smarty.class.php on line 1102 |
The layout directories and the contained files have permission 770. My directories look like that:
- smarty
- content
--- index.php
- layout
--- cache
--- configs
--- templates
--- templates_c
The variables have absolute paths (DOCUMENT_ROOT = /www/htdocs/trailhun/) like it is recommended by mohrt in thread unable to read resource.
Code: |
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].'layout/templates/';
$this->compile_dir = $_SERVER["DOCUMENT_ROOT"].'layout/templates_c/';
$this->config_dir = $_SERVER["DOCUMENT_ROOT"].'layout/configs/';
$this->cache_dir = $_SERVER["DOCUMENT_ROOT"].'layout/cache/';
|
Some facts about the webserver:
Apache/1.3.29 (Unix) mod_fastcgi/2.4.2 FrontPage/5.0.2.2635 PHP/4.3.9
Does anyone have an idea ...? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Oct 06, 2004 4:43 pm Post subject: |
|
|
Does this file exist and readable by the web server user?
/www/htdocs/trailhun/layout/templates/index.tpl.html
You can probably test this directly since everything is installed under document root:
http://www.mydomain.com/layout/templates/index.tpl.html
See if anything shows up. |
|
Back to top |
|
dave Smarty n00b
Joined: 06 Oct 2004 Posts: 4
|
Posted: Wed Oct 06, 2004 5:14 pm Post subject: |
|
|
That was a fast reply, thanks!
After changing permissions from 770 to 775, the template showed up in the browser.
Afterwards I tried index.php again and got a different error message:
Code: | atal error: Smarty error: unable to write to $compile_dir '/www/htdocs/trailhun/layout/templates_c'. Be sure $compile_dir is writable by the web server user. in /www/htdocs/trailhun/smarty/Smarty.class.php on line 1102 |
I also set permissions for folder templates_c to 775. That had no effect. Then I set it to 777 and tried index.php one more time. Now it says:
Code: | Fatal error: Call to undefined function: smarty_core_write_file() in /www/htdocs/trailhun/smarty/core/core.write_compiled_resource.php on line 30 |
Hmm ... I hope that's a step forward! |
|
Back to top |
|
dave Smarty n00b
Joined: 06 Oct 2004 Posts: 4
|
Posted: Wed Oct 06, 2004 5:31 pm Post subject: |
|
|
OK, I have just seen, that core.write_file.php hasn't been uploaded properly. I don't get error messages anymore but have other problems. (Header and footer are not included.)
But to get back to the original problem. I thought it would be sufficient to set everything to 770. It says so in the documentation. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Oct 06, 2004 5:58 pm Post subject: |
|
|
Quote: | Technical Note: chmod 770 will be fairly tight security, it only allows user "nobody" and group "nobody" read/write access to the directories. If you would like to open up read access to anyone (mostly for your own convenience of viewing these files), you can use 775 instead. |
Sure, you can use 770 but your webserver will have to be configured to use the appropriate user. Here's a trick: create the subdirs from a PHP script with 770 that way the "correct" user ought have the appropriate privledges. |
|
Back to top |
|
dave Smarty n00b
Joined: 06 Oct 2004 Posts: 4
|
Posted: Wed Oct 06, 2004 8:50 pm Post subject: |
|
|
Thanks, I will do that! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|