Re: [SMARTY] warnings when writing compiled templates
| From: | messju mohr | Date: | Tue, 08 Apr 2003 12:57:26 +0000 |
| Subject: | Re: [SMARTY] warnings when writing compiled templates | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9190@lists.php.net to get a copy of this message | ||
On Tue, Apr 08, 2003 at 03:30:17AM +0100, Bjørn Eikeland wrote:
> I've just installed smarty 2.4.2 on my web host, but the when the template
> needs to be compiled I get the following to warnings:
>
> chmod failed: Operation not permitted in
> /pub/home/bjorn110/htdocs/smarty/Smarty.class.php on line 1994
> utime failed: Operation not permitted in
> /pub/home/bjorn110/htdocs/smarty/Smarty.class.php on line 1518
>
> I have chmodded the templates_c/ foldeer to 777 (Host doesnt allow chown)
> and the compiled template file is written and works just fine. If the file
> is written and is readable by the browser and the filesystem changes the
> timestamp for the compiled template when its written can I safely comment
> out those two lines? The system apears to be working, templates recompile if
> changed, and I dont get the errors if the template isnt changed.
yes it should work.
alternatively you could try to make the webserver create the
templates_c -directory to get rid of the warnings:
- remove temlates_c
- apply chmod 777 to the directory that contains templates_c (just for a
short period, see below)
- run a phpscript on the webserver:
<?php mkdir ('...path_to_your_installation/templates_c'); ?>
- revert the permission of the directory that contains templates_c back to
755 or sth. like that.
now templates_c is owned by the webserver-user and so smarty is
allowed to do chmod() and touch() on files in it.
caveat: i didn't test sth. like that with safe_mode=On . i think this
may not work, since php refuses to open files inside directories that
are not owned, by the user running the owning script. but i don't know
all safe-mode-rules by heart, so ymmv.
greetings
messju
> thanks,
> Bjorn