Under Ubuntu open php debugging mode to report error information solution
- 2020-05-14 05:55:05
- OfStack
Under Ubuntu, open php debugging mode to report error information solution
The default setting for php under Ubuntu is not to display an error message, and if the program fails it will display an "error message indicating that this request cannot be processed," which is very inconvenient in a development environment.
In fact, we just need to edit the apache configuration file
1, my apache configuration file directory is/etc apache2 / apache2 conf
sudo vim /etc/apache2/apache2.conf
Finally, add the following two lines
php_flag display_errors on
php_value error_reporting 2039
2. Restart apache
sudo service apache2 restart
This completes the display of the error message.
Note: if not, change the configuration under php.ini (I haven't changed it, but it can be displayed, because the code added above is already turned on)
sudo vim /etc/php/7.0/cli/php.ini
Search display_errors display_errors=Off display_errors=On save exit and restart apache2
Thank you for reading, I hope to help you, thank you for your support of this site!