[英]Disable strict standards in PHP 5.3.8
I am using strict standards option in PHP but I want to disable it because Joomla doesn't like it and I have to use Joomla on my localhost. 我在PHP中使用严格的标准选项,但我想禁用它,因为Joomla不喜欢它,我必须在我的localhost上使用Joomla。
In response to another question on this site, this solution was given: E_ALL & ~E_DEPRECATED & ~E_STRICT
but this didn't work for me. 在回答本网站上的另一个问题时,给出了这个解决方案:
E_ALL & ~E_DEPRECATED & ~E_STRICT
但这对我不起作用。 I think it only works for PHP 5.4 while I am using 5.3.8. 我认为它只适用于PHP 5.4,而我使用的是5.3.8。
Can anyone tell me what I should use? 谁能告诉我应该用什么? I am currently using
error_reporting(E_ALL & ~E_NOTICE)
. 我目前正在使用
error_reporting(E_ALL & ~E_NOTICE)
。 Also I am using ini_set('display_errors')
but there are still errors shown that are related to strict standards. 我也在使用
ini_set('display_errors')
但仍然显示与严格标准相关的错误。
So how can I disable strict standard errors? 那么如何禁用严格的标准错误呢?
I have the same problem. 我也有同样的问题。 This is how I fix it in joomla.
这就是我在joomla中修复它的方法。
Set error_reporting in configuration.php of joomla to "30711" (equal to E_ALL & ~E_NOTICE & ~E_STRICT) 将joomla的configuration.php中的error_reporting设置为“30711”(等于E_ALL&~E_NOTICE&~E_STRICT)
just messed around with this and would like to share my own results. 只是弄乱了这个并想分享我自己的结果。 I did not do it runtime using php, I did it in the php.ini file.
我没有使用php做运行时,我在php.ini文件中做到了。
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
Remeber to restart the server afterwards .... 记得事后重启服务器....
I tried thanhtd's solution, but it didn't not work for me. 我尝试过thanhtd的解决方案,但它并不适合我。 However, I changed the error_reporting value to '1' instead of the default '0' in my configuration.php file for Joomla (2) and that worked.
但是,我将error_reporting值更改为'1',而不是在我的configuration.php文件中为Joomla(2)更改了默认值'0',这是有效的。 So thanks to thanhtd for getting me on the right path.
所以感谢thanhtd让我走上了正确的道路。
to suppress all errors use E_NONE
使用
E_NONE
来抑制所有错误
you might also want to use display_errors(0)
你可能还想使用
display_errors(0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.