开发者

Smarty compile_dir permission denied

After moving php-files from windows to linux(centos) I started getting the fol开发者_开发百科lowing permissions errors:

ERRNO: 2
TEXT: rename(/tmp/wrtwetuti,/var/www/site1/presentation//compile_dir/ee63ba1108c61f830b5d6155f21b1bcd04684f7e.file.category.tpl.php): Permission denied
LOCATION: /var/www/site1/libs/smarty_3/sysplugins/smarty_internal_write_file.php, line 48, at September 9, 2011, 4:05 am

When for testing purposes chmoded compile_dir to 777, the problem goes away.

I wonder if anybody knows a solutions for it. Would installing suPHP solve this problem?


compile_dir is supposed to be writable by the web server (and also outside your web root). So you should:

  • move it out of your web root
  • assign ownership to the web server user
  • chmod it to 700

The fact that on your Windows install the default compile_dir was also writable by the web server is typical for that OS, and doesn't mean that there is something to fix on Linux.


You can look at this page: http://www.smarty.net/docs/en/installing.smarty.basic.tpl "Smarty will need write access (windows users please ignore) to the $compile_dir and $cache_dir directories (templates_c/ and cache/), so be sure the web server user account can write to them".

hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜