The solution to php not outputting error information: first open "php.ini"; then modify the content to "error_reporting = E_ALLdisplay_errors = On"; finally save the changes.
#The operating environment of this article: Windows 7 system, PHP 7.1 version, Dell G3 computer.
Recommended: "PHP Video Tutorial"
Operating environment for this tutorial : Windows 7 system, PHP 7.1 version, this method is suitable for all brands of computers.
Solution to php not outputting error messages
After installing lnmp, the browser page does not output errors, but the error message can be seen in the nginx error log. The reason php-fpm does not output error messages by default, because when we install yum, we use the php.ini configuration environment of the production environment by default. This must be blocked in the production environment, otherwise people will see all your errors and your code will be It's not safe anymore.
Solution:
vim /etc/php.ini
Just change the following two items!
error_reporting = E_ALLdisplay_errors = On
If you want to temporarily output the error on the page, just add the following code at the top of the page where you want to output the error!
error_reporting(-1);ini_set('display_errors', 1);
See it, the cute error page is out again!
The above is the detailed content of What should I do if php does not output error messages?. For more information, please follow other related articles on the PHP Chinese website!