管理员修改页面 OpenCart 2.1.0.2 警告并报错

Warning and get error in admin modification page OpenCart 2.1.0.2

当我点击 admin > Extensions > Modifications 页面中的刷新按钮时,页面崩溃并在 OpenCart 2.1.0.2 中生成失败错误页面

出现以下错误。请帮我。我该如何解决这个问题。

Warning: fopen(/home/onlybrands1/public_html/system/modification/system/engine/action.php) failed to open stream: No such file or directory in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 408

Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 410

Warning: fclose() expects parameter 1 to be resource, boolean given in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 412

Warning: fopen(/home/onlybrands1/public_html/system/modification/system/engine/loader.php): failed to open stream: No such file or directory in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 408

Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 410

Warning: fclose() expects parameter 1 to be resource, boolean given in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 412

Warning: fopen(/home/onlybrands1/public_html/system/modification/system/library/config.php): failed to open stream: No such file or directory in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 408

Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 410

Warning: fclose() expects parameter 1 to be resource, boolean given in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 412

Warning: fopen(/home/onlybrands1/public_html/system/modification/system/library/language.php): failed to open stream: No such file or directory in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 408

Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/onlybrands1/public_html/admin/controller/extension/modification.phpon line 410

Warning: fclose() expects parameter 1 to be resource, boolean given in /home/onlybrands1/public_html/admin/controller/extension/modification.php on line 412

Warning: Cannot modify header information - headers already sent by (output started at /home/onlybrands1/public_html/admin/index.php:80) in /home/onlybrands1/public_html/system/library/response.php on line 12

只需将~/system/modification/ 文件夹的权限更改为可写 (777)。

参考Link:http://forum.opencart.com/viewtopic.php?t=144373

我意识到了。此问题发生在 config.php 文件中的错误路径。已修改文件夹位置更改(在 storage 文件夹内)比 OpenCart 2.1.0.2 中的旧版本由 OpenCart.

并且,一些用户使用托管服务提供商服务的快速设置功能安装 OpenCart。因此,在 OpenCart 2.1.x 中具有托管快速安装功能的 config.php 文件中未设置正确的路径。版本。

在这里,您需要在config.php中为DIR_CACHEDIR_DOWNLOADDIR_LOGSDIR_MODIFICATIONDIR_UPLOAD设置正确的路径(front & admin两个 config.php) 文件。

OpenCart 2.1.0.2 路径错误。(以下路径适用于 2.0.x 版本)

define('DIR_CACHE', 'YOURSITE/system/cache/');
define('DIR_DOWNLOAD', 'YOURSITE/system/download/');
define('DIR_LOGS', 'YOURSITE/system/logs/');
define('DIR_MODIFICATION', 'YOURSITE/system/modification/');
define('DIR_UPLOAD', 'YOURSITE/system/upload/');

OpenCart 2.1.0.2 的正确路径。 在这里,您需要在以下路径中添加 /storage/。 (前面和管理员都 config.php 文件)

define('DIR_CACHE', 'YOURSITE/system/storage/cache/');
define('DIR_DOWNLOAD', 'YOURSITE/system/storage/download/');
define('DIR_LOGS', 'YOURSITE/system/storage/logs/');
define('DIR_MODIFICATION', 'YOURSITE/system/storage/modification/');
define('DIR_UPLOAD', 'YOURSITE/system/storage/upload/');

希望对您有所帮助。

我遇到了来自环回 IP 地址的类似问题。但是在实时站点上,警告被抑制了,因为存储目录被手动移动到 YOURSITE/system/storage 并且在 config.php[=42= 中配置不正确] 我无法获得前端显示,因为它正在显示

Go to admin, find Extensions >> Modifications and click 'Refresh' button. To apply the changes characterized by the uploaded modification file

OpenCart 3.0.2.x版本中,管理员端有通知:

It is very important that you move the storage directory outside of the web directory (e.g. public_html, www or htdocs)

为了纠正问题的根本原因并在更正 config.php 之后,上面的引用没有显示。它开始显示在弹出屏幕中,终于注意到,这就是问题所在。按照以下步骤摆脱:

config.php 文件

的前端和管理端更改以下代码

来自

define('DIR_STORAGE', 'YOURSITE/storage/');

define('DIR_STORAGE', 'YOURSITE/system/storage/');

正在修改

$ sudo chmod -R 777 /var/www/html/YOURFOLDER/*

解决了前端和后端的问题