Disable strict standards in PHP 5.3.8

我与影子孤独终老i 提交于 2019-12-05 02:24:25

问题


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.

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. I think it only works for PHP 5.4 while I am using 5.3.8.

Can anyone tell me what I should use? I am currently using 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.

So how can I disable strict standard errors?


回答1:


I have the same problem. This is how I fix it in joomla.

Set error_reporting in configuration.php of joomla to "30711" (equal to E_ALL & ~E_NOTICE & ~E_STRICT)




回答2:


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.

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

Remeber to restart the server afterwards ....




回答3:


I tried thanhtd's solution, but it didn't not work for me. 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. So thanks to thanhtd for getting me on the right path.




回答4:


to suppress all errors use E_NONE

you might also want to use display_errors(0)



来源:https://stackoverflow.com/questions/8705808/disable-strict-standards-in-php-5-3-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!