|
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 |
zerg Smarty n00b
Joined: 27 Nov 2003 Posts: 2 Location: Russia, Moscow
|
Posted: Thu Nov 27, 2003 1:14 pm Post subject: Warning: touch(): SAFE MODE Restriction in effect |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Nov 27, 2003 1:24 pm Post subject: |
|
|
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 |
|
zerg Smarty n00b
Joined: 27 Nov 2003 Posts: 2 Location: Russia, Moscow
|
Posted: Thu Nov 27, 2003 1:37 pm Post subject: |
|
|
You are right. I fixed the problem. Thank you very much. |
|
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
|