Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Warning: touch(): SAFE MODE Restriction in effect

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
zerg
Smarty n00b


Joined: 27 Nov 2003
Posts: 2
Location: Russia, Moscow

PostPosted: Thu Nov 27, 2003 1:14 pm    Post subject: Warning: touch(): SAFE MODE Restriction in effect Reply with quote

Smarty-2.6.0
Apache-1.3.28
Php-4.3.2
-------------
//index.php
define('SMARTY_DIR','/www/htdocs/Smarty/');
require(SMARTY_DIR.'Smarty.class.php');

$smarty = new Smarty;
$smarty->use_sub_dirs = false;
$smarty->template_dir = '/www/htdocs/smarty/demo/templates/';
$smarty->compile_dir = '/www/htdocs/smarty/demo/templates_c/';
$smarty->config_dir = '/www/htdocs/smarty/demo/configs/';
$smarty->cache_dir = '/www/htdocs/smarty/demo/cache/';

$smarty->assign('name','test');

$smarty->display('index.tpl');

-------------

Warning: Smarty error: problem writing temporary file '/www/htdocs/smarty/demo/templates_c/3fc5f50da8619' in /www/htdocs/Smarty/Smarty.class.php on line 1144

Warning: touch(): SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /www/htdocs/smarty/demo/templates_c owned by uid 99 in /www/htdocs/Smarty/core/core.write_compiled_resource.php on line 31

Warning: fetch(/www/htdocs/smarty/demo/templates_c//%%117^%%1172603085^index.tpl.php): failed to open stream: No such file or directory in /www/htdocs/Smarty/Smarty.class.php on line 1291

Warning: fetch(): Failed opening '/www/htdocs/smarty/demo/templates_c//%%117^%%1172603085^index.tpl.php' for inclusion (include_path='.') in /www/htdocs/Smarty/Smarty.class.php on line 1291
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Nov 27, 2003 1:24 pm    Post subject: Reply with quote

your script (the php-file) is owned by uid 0 (root). templates_c is owned by uid 99 (nobody on many systems). safe_mode prevents writing into templates_c then.

make sure the webserver can write to templates_c via group-permissions (if the gid of the webserver is 99 for example)

chown 0.99 templates_c
chmod g+rwxs templates_c

the s is "sticky-group". you'll want that on linux but don't need it on bsd, AFAIK.

and maybe don't use root for your php-files but another user (not nobody).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
zerg
Smarty n00b


Joined: 27 Nov 2003
Posts: 2
Location: Russia, Moscow

PostPosted: Thu Nov 27, 2003 1:37 pm    Post subject: Reply with quote

You are right. I fixed the problem. Thank you very much. Razz
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP