When the php debugging mode is enabled in Ubuntu, the error message is displayed. the default setting of php in Ubuntu does not display the error message. if a program error occurs, the error message "cannot process this request" is displayed ", this is inconvenient in the development environment.
In fact, we only need to edit the apache configuration file.
1. the directory of my apache configuration file is/etc/apache2/apache2.conf.
Sudo vim/etc/apache2/apache2.conf
Then add the following two lines.
Php_flag display_errors on
Php_value error_reporting 2039
2. restart apache
Sudo service apache2 restart
In this way, the error message is displayed.
Note: If you cannot change the configuration in php. ini, you can view the configuration in php. ini)
Sudo vim/etc/php/7.0/cli/php. ini
Search for display_errors. the default value is display_errors = Off and changed to display_errors = On. save and restart apache2.
Related articles
The problem that php5.6 cannot be installed on ubuntu 16
Install the mongodb extension command of PHP in Ubuntu
Solve the problem of ERROR 1045 (28000) when installing mysql5.7.17 on ubuntu16.04.