Home >Backend Development >PHP Tutorial >ubuntu - In development environment, php7 nginx displays error message

ubuntu - In development environment, php7 nginx displays error message

WBOY
WBOYOriginal
2016-07-06 13:53:25975browse

How can I display the error message directly?
My development environment ubuntu 16.04 php 7.0.7 php-fpm nginx

Now when there is an error in the code, it will only output An internal server error occurred.

I hope that the error message can be displayed directly on the web page to facilitate development. Thanks.

Reply content:

How can I display the error message directly?
My development environment ubuntu 16.04 php 7.0.7 php-fpm nginx

Now when there is an error in the code, it will only output An internal server error occurred.

I hope that the error message can be displayed directly on the web page to facilitate development. Thanks.

set_error_handler registers error handling mechanism
set_exception_handler registers exception handling mechanism

These two methods allow you to intercept when an error occurs and add your own logic processing

Just turn on all error messages. . php-fpm requires one more step, which is to turn on the error display in the configuration file of php-fpm

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