无法禁用OpenCart(PHP)中的错误报告 [英] Can't disable error reporting in OpenCart (PHP)
问题描述
我似乎无法禁用PHP中的错误报告-我已经尝试了所有方法,但仍然显示通知"错误.
I can't seem to disable error reporting in PHP - I have tried everything but "Notice" errors are still displayed.
我的php.ini有
display_errors = Off;
error_reporting = 0;
我的.htaccess有
My .htaccess has
php_value error_reporting 0
我的脚本有
ini_set('display_errors', 'Off');
ini_set('log_errors', 1);
ini_set('error_reporting', 0);
ini_set('display_startup_errors', 'Off');
php_info();
echo $my_undefined_var;
php_info()输出确认display_errors和error_reporting确实为off和0,但是我仍然会收到通知,
The php_info() output confirms that display_errors and error_reporting are indeed off and 0, and yet I still get a notice,
注意:未定义的变量:/my/site/path/index.php中的my_undefined_var吗?等等……
Notice: Undefined variable: my_undefined_var in /my/site/path/index.php?blahblah...
请注意,这是一个OpenCart网站(我的更改位于管理员"部分).我试过在与index.php相同的目录中创建一个测试php脚本,这很好.
Note this is an OpenCart website (and my change is in the Admin section). I have tried creating a test php script in the same directory as index.php and it's fine.
还有其他什么可以覆盖error_reporting(0)
吗?
Is there anything else that could be overriding the error_reporting(0)
?
我已经对整个站点做了一个grep,以查找并禁用对error_reporting和display_errors的所有提及,但无济于事.
I've done a grep of the entire site to find and disable all mentions of the error_reporting and display_errors but to no avail.
推荐答案
OpenCart仪表板中有一个设置,可让您打开(或关闭)错误报告和日志记录.
There is a setting within the OpenCart dashboard that allows you to turn on (or off) error reporting and logging.
- 登录到仪表板
- 在菜单中,转到系统",然后选择设置"
- 在商店列表中,为商店单击编辑"
- 点击服务器"标签.
- 向下滚动,有两个设置:
一种.记录错误-根据需要设置
b.显示错误-将此设置为否"
- Log into your dashboard
- In the menu, go to "System" and select "Settings"
- In the list of stores, click "Edit" for your store
- Click the "Server" tab.
- Scroll down, and there's two settings:
a. Log Errors - set this as desired
b. Display Errors - set this to "No"
这篇关于无法禁用OpenCart(PHP)中的错误报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!