Zend Framework - not all errors are shown

后端 未结 2 1044
北海茫月
北海茫月 2021-01-22 16:57

In an action method, I have the following excerpt of code:

error_reporting(E_ALL);
ini_set(\'display_errors\', \'1\');
Logger::log(\'test\');

T

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-22 17:24

    You also have to enable display_startup_errors to show Fatal errors:

    Even when display_errors is on, errors that occur during PHP's startup sequence are not displayed. It's strongly recommended to keep display_startup_errors off, except for debugging.

    Also see the Note for display_errors:

    Although display_errors may be set at runtime (with ini_set()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed.

    You can set both values in Zend Framework's application.ini. On a sidenote: if you set error_reporting(-1) it will report (!display) all errors, including E_STRICT and any future additions.

提交回复
热议问题