Enable php debugging mode in Ubuntu to display the error message

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.