PHP Open Slow Log

Source: Internet
Author: User

The default is to use the local installation path

cd/usr/local/php/etc/

Vim php-fpm.conf

; TheLog file  forslow requests;DefaultValue:Not set; Note: Slowlog is mandatoryifRequest_slowlog_timeout is Setslowlog=Log/pool.Log.Slow//can modify the path of the slow log; The timeout forserving a single request after which a PHP backtrace would be, dumped to the' Slowlog 'file. A value of ' 0s ' means ' off '.; Available units: S (econds) (default), M (inutes), H (ours),or D (ays);Defaultvalue:0Request_slowlog_timeout= 1//Slow log time-out

But the directory needs to be created manually, or the restart PHP-FPM will be wrong

Mkdir/usr/local/php/log

PHP-FPM Slow Log example, the slow log will record the process number, the script name, which file which line of code which function execution time is too long.

View slow log files tail-10f pool.log.show

[19-sep-2014 11:34:12]  [Pool www] pid 2957=/data/wwwroot/cms.91.com/webroot/mobile91. php[0X00000000030C6C10] Request_by_curl ()/data/wwwroot/cms.91.com/webroot/mobile91.php:207[ 0X00000000030C6190] Request_by_curl ()/data/wwwroot/cms.91.com/webroot/mobile91.php:189[19-Sep-2014 11:34:47]  [pool www] pid 2968=/data/wwwroot/cms.91.com/webroot/mobile91.  php[0x000000000300b840] Request_by_curl ()/data/wwwroot/cms.91.com/webroot/mobile91.php:206[ 0X000000000300ADC0] Request_by_curl ()/data/wwwroot/cms.91.com/webroot/mobile91.php:189



PHP Open Slow Log

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.