PHP.ini and php-fpm.conf configuration file differences

Source: Internet
Author: User
Tags fpm sleep function

Original: http://www.cnblogs.com/xiaozong/p/5724984.html

--------------------------------------------------------------------------------------------------------------- ----

Php-fpm.conf is a unique configuration file for PHP-FPM

PHP.ini is therefore a required configuration file in PHP mode

The difference is that php-fpm.conf is the configuration file for the PHP-FPM process Manager, PHP.ini is the PHP parser configuration file

There are also/fpm.d/www.conf configuration files in the PHP version of the configuration file path

This is an extension file for the php-fpm.conf configuration file that you can open php-fpm.conf file to view

; include=fpm.d/*.conf

We can use php-fpm.conf to configure slow logs

We can turn on the slow log function.

slowlog = /usr/local/var/log/php-fpm.log.slowrequest_slowlog_timeout = 5s

When a request takes more than 5 seconds, the corresponding record is recorded in the slow log, notice that the time 5s above, the unit can not be ignored, the corresponding other units, M points, H (of course, this is too ridiculous)

php-fpm Slow log will record the process number, the script name, which file which line of code which function execution time is too long :

  1. [21-Nov-2016 10:30:38] [pool www] pid 11877
  2. script_filename = /var/www/ceshi/c.php
  3. [0xb70fb88c]< Span class= "PLN" > sleep ()  /var/www/ceshi/c.php< Span class= "PLN" >< Span class= "PLN" >< Span class= "PLN" >< Span class= "PLN" >:2

with the log , we know that the Sleep function on line 2nd is a bit problematic, so we can track the problem .

More configuration, which will be summarized later.

PHP.ini and php-fpm.conf configuration file differences

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.