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

php怎么显示异常信息

WBOY
WBOYOriginal
2016-06-13 12:23:171163browse

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>

如果有设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>

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

Statement:
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