Error message for enabling php-fpm in Nginx

Source: Internet
Author: User
Tags php error
When using nginx, nginx always encounters a 500 error. However, you need to go to the background to check the error-log.

When using nginx, nginx always encounters a 500 error. However, you need to go to the background to check the error-log, which is inconvenient.
I would like to introduce a small method for you. it is very useful when debugging php, but it is not recommended to enable this function on the online server.

First, enable the error message prompt function of php.

Vim/etc/php5/fpm/php. ini

Open error prompt

Display_errors = On

Because the four fpm used with nginx, so also need to modify the php-fpm.conf file

Vim/etc/php5/fpm/php-fpm.conf

Add

Php_flag [display_errors] = on

Someone asked, this parameter does not exist in php-fpm. Yes, you cannot find it in it.

You need to find the configuration parameters in another path. For more information, see php-fpm configuration.

Vim/etc/php5/fpm/pool. d/www. conf

In fact, it doesn't matter if you don't look for it. just paste it directly, and then read the nginx configuration again.

Sudo service nginx reload

Modify a php error at will, and refresh the page to see the familiar error message.

Related Article

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.