Home > Backend Development > PHP Tutorial > php怎么显示异常信息

php怎么显示异常信息

WBOY
Release: 2016-06-13 12:23:17
Original
1199 people have browsed it

php如何显示错误信息

php默认不打印错误,如需打印,

vi $PHP_HOME/etc/php.ini, 修改以下几项:

<code class=" hljs ini"><span class="hljs-setting">display_errors = <span class="hljs-value"><span class="hljs-keyword">On</span></span></span><span class="hljs-setting">error_reporting = <span class="hljs-value">E_ALL & ~E_NOTICE</span></span></code>
Copy after login

如果有设error_log变量,注释掉输出到error_log这句话就可以将错误直接显示在terminal了

然后重启php:

<code class=" hljs lasso"><span class="hljs-variable">$PHP_HOME</span>/sbin/php<span class="hljs-attribute">-fpm</span> start</code>
Copy after login

版权声明:本文为博主原创文章,未经博主允许不得转载。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template