禁用php.ini文件中的E_STRICT错误仍然会引发错误 [英] Disable E_STRICT errors in php.ini file still throws the errors

查看:159
本文介绍了禁用php.ini文件中的E_STRICT错误仍然会引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试禁用我的php.ini文件中的E_STRICT错误,但仍会引发错误.我正在将PHP 5.4.10MAMP(不是PRO版本)一起使用.

I'm trying to disable E_STRICT errors in my php.ini file but it still throws the error. I'm using PHP 5.4.10 with a MAMP (not PRO version).

使用phpinfo我已经将php.ini文件放置在/Applications/MAMP/bin/php/php5.4.10/conf/php.ini

With phpinfo I've located the php.ini file in /Applications/MAMP/bin/php/php5.4.10/conf/php.ini

我已更改:

error_reporting = E_ALL

error_reporting = E_ALL & ~E_STRICT

然后我重新启动了Apache,但是它仍然抛出错误,我错了?

Then i've restarted Apache but it still throw the error, where I'm wrong?

推荐答案

使用error_reporting = E_ALL ^ E_STRICT.

如果您无权访问php.ini,则可以将其放在.htaccess文件中:

If you didn't have access to php.ini, you could put this in your .htaccess file:

php_value error_reporting 30711

这是E_ALL值(32767),并删除了E_STRICT(2048)和E_NOTICE(8)值.

This is the E_ALL value (32767) and the removing the E_STRICT (2048) and E_NOTICE (8) values.

如果您无权访问.htaccess文件或未启用该文件,则可以将其放在任何脚本的PHP部分的顶部

If you don't have access to the .htaccess file or it's not enabled, you can put this at the top of the PHP section of any script

error_reporting(E_ALL ^ E_STRICT)

这篇关于禁用php.ini文件中的E_STRICT错误仍然会引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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