Как скрыть ошибки фреймворка в браузере?
Я ищу в application.config, Application module.config пытался изменить флаги и шаблоны, но безрезультатно.
Как скрыть ошибки в браузере, но оставить их в консоли?
В качестве сервера я использую сейчас встроенный в php5.6 сервер
'view_manager' => [
'display_not_found_reason' => true,
'display_exceptions' => false,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => [
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'error/404' => __DIR__ . '/../view/error/custom_404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
],
'template_path_stack' => [
__DIR__ . '/../view',
],
],
Есть два способа сделать это, потому что Zend — это PHP-фреймворк, поэтому вы можете скрыть его с помощью php-кода или файла настроек Zend.
1) Основной PHP.
error_reporting(E_ALL);
ini_set('display_errors', true);
2) Zend изменить ваши настройки в соответствии с вашим требованием false скрыт вашу ошибку.
/*in your module.config.php */
'view_manager' => array(
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => array(
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'/index/index' => __DIR__ . '/../view/user/index/index.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
),
'template_path_stack' => array(
__DIR__ . '/../view',
),
),
Других решений пока нет …