Open PHP debug mode under Ubuntu, display error message

Source: Internet
Author: User
Tags php debug

In Ubuntu, the default setting for PHP is not to display the error message, if the program error will show "Unable to process this request error", which is very inconvenient in the development environment.

Actually, 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

Then add the following two lines to the end

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 it is not possible to change the configuration under php.ini (I do not have changes can be displayed, because the code added above is already open)

sudo vim/etc/php/7.0/cli/php.ini

Search display_errors default is display_errors=off change to Display_errors=on save quit restart Apache2

  

Open PHP debug mode under Ubuntu, display error message

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.