2017-02-16 16:26 阅读 86

php.ini error_reporting设置为E_ALL但不起作用

In my php.ini file on wampserver I have the following lines set:

error_reporting = E_ALL
display_errors = On

Yet, I have to actually call error_reporting(E_ALL) in my script in order for it to actually show the errors.

Why is this happening? I'm getting to my php.ini through the wampserver icon -> php -> php.ini

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    dongmeng4742 dongmeng4742 2017-02-16 17:48

    I was using the @ suppression modifier in front of call_user_func_array in my Router front-end controller class which was resetting error_reporting to 0.

    点赞 评论 复制链接分享
  • dongzhangnong2063 dongzhangnong2063 2017-02-16 16:32

    In WAMPServer there are 2 php.ini files:

    1. \wamp\bin\php\php{version}\php.ini (controls only PHP CLI)

    2. and the one that controls the Apache/PHP environment.

    Edit the Apache version by using the wampmanager menus, so you get the right one.


    This will open the correct file in your default editor. Change the parameters in this file, save it and restart Apache.

    BEWARE: If as you say you are using the correct method to edit the correct file -

    These parameters are also documented at the top of the php.ini file, do not change the documentation version, look further down the file and edit the actual parameters there.

    点赞 评论 复制链接分享