Home >Backend Development >PHP Tutorial >ubuntu - In development environment, php7 nginx displays error message
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.
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