如何解决错误“致命错误:未捕获->聪明:无法写入档案? [英] How to fix error "Fatal error: Uncaught --> Smarty: unable to write file"?

查看:105
本文介绍了如何解决错误“致命错误:未捕获->聪明:无法写入档案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用digitalocean将Prestashop从本地主机迁移到网站域,但是当我打开此网站时出现此错误

I migrated Prestashop from localhost to website domain using digitalocean, but when I open this website I get this error

致命错误:没捉住->聪明:无法写入文件/var/www/html/prestashop/cache/smarty/compile/a4/36/f1/wrt549a35e49b3b44_77591243<-抛出/var/www/html /prestashop/tools/smarty/sysplugins/smarty_internal_write_file.php在第46行.

Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/prestashop/cache/smarty/compile/a4/36/f1/wrt549a35e49b3b44_77591243 <-- thrown in /var/www/html/prestashop/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46.

我试图将smarty文件夹的权限更改为755,但是它不起作用.我不知道该如何解决.

I tried to change permissions on the smarty folder to 755, but it didn't work. I don't know how to fix it.

推荐答案

您的问题肯定是关于权限的.这取决于Apache和PHP的设置方式.

You problem is definitely about permissions. It depends on how Apache and PHP are set up.

首先,检查谁拥有文件夹.例如,简单的apache2和php安装以www-data用户身份运行.例如,如果您使用"user1"连接到FTP并将文件上传到那里,则文件归您所有.该组也可能设置为"user1".

First, check who owns the folders. For example, simple apache2 and php installation runs as www-data user. For example, if you connected to FTP with 'user1' and uploaded your files there, then the files are owned by you. The group is probably also set to 'user1'.

因此,您可以修改,写入文件,但是PHP进程不能,因为它们不拥有文件(例如,PHP以www-data的形式运行).

Therefore, you can modify, write the files, but PHP processes cannot, because they dont own the files (PHP runs as www-data, for example).

您最好的选择是与服务器管理员联系,并请他帮助您.

Your best bet is to contact server administrator and ask him to help you out.

记住:切勿为网站上的任何文件/文件夹设置777,以正确的方式解决问题.

Rememeber: never set 777 for any files/folders on a website, solve the problem the correct way.

这篇关于如何解决错误“致命错误:未捕获-&gt;聪明:无法写入档案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆