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

php.ini error_reporting set to E_ALL but not working

在 wampserver 上的 php.ini 文件中,我设置了以下行:

error_reporting = E_ALL
display_errors = On

然而,我必须在我的脚本中调用 error_reporting(E_ALL) 才能真正显示错误。

为什么会这样?我正在通过 wampserver 图标进入我的 php.ini -> php -> php.ini

在 WAMPServer 中有 2 个 php.ini 个文件:

  1. \wamp\bin\php\php{version}\php.ini(仅控制 PHP CLI)

  2. 和控制 Apache/PHP 环境的那个。

使用 wampmanager 菜单编辑 Apache 版本,以便获得正确的版本。

wampmanager->PHP->php.ini

这将在您的默认编辑器中打开正确的文件。更改此文件中的参数,保存并重新启动 Apache。

注意: 如果如您所说,您正在使用正确的方法编辑正确的文件 -

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.

我在我的路由器 front-end 控制器 class 中的 call_user_func_array 前面使用了 @ 抑制修饰符,它正在将 error_reporting 重置为 0.