hellopasswd
创新互联建站专业为企业提供玉门网站建设、玉门做网站、玉门网站设计、玉门网站制作等企业网站建设、网页设计与制作、玉门企业网站模板建站服务,十余年玉门做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。vi /usr/local/php-fpm/etc/php-fpm.d/www.conf request_slowlog_timeout=1 slowlog=/usr/local/php-fpm/var/log/www-slow.log
配置nginx的虚拟主机test.com.conf,把unix:/tmp/php-fcgi.sock改为unx:/tmp/www.sock
重新加载nginx服务
vi /data/wwwroot/test.com/sleep.php
<?php echo "test slow log"; sleep(2); echo "done"; ?>
curl -x 127.0.0.1:80 test.com/sleep.php
cat /usr/local/php-fpm/var/log/www-slow.log
[root@localhost php-fpm.d]# vi www.conf 1 [www] 2 listen = /tmp/php-fcgi.sock 3 listen.mode = 666 4 user = php-fpm 5 group = php-fpm 6 pm = dynamic 7 pm.max_children = 50 8 pm.start_servers = 20 9 pm.min_spare_servers = 5 10 pm.max_spare_servers = 35 11 pm.max_requests = 500 12 rlimit_files = 1024 13 request_slowlog_timeout = 1 14 slowlog = /usr/local/php-fpm/var/log/www-slow.log [root@localhost php-fpm.d]# /usr/local/php-fpm/sbin/php-fpm -t [10-Jan-2018 08:13:55] NOTICE: configuration file /usr/local/php-fpm/etc/php-fpm.conf test is successful [root@localhost php-fpm.d]# /etc/init.d/php-fpm reload Reload service php-fpm done
[root@localhost php-fpm.d]# ls /usr/local/php-fpm/var/log/ php-fpm.log www-slow.log [root@localhost php-fpm.d]# vi /data/wwwroot/test.com/sleep.php 1 <?php 2 echo "test slow log"; 3 sleep(2); 4 echo "done"; 5 ?>
[root@localhost php-fpm.d]# curl -x 127.0.0.1:80 test.com/sleep.php
[root@localhost php-fpm.d]# vi /usr/local/php-fpm/etc/php.ini /display_errors 462 ; Default Value: On 463 ; Development Value: On 464 ; Production Value: Off 465 ; http://php.net/display-errors 466 display_errors = Off 467 468 ; The display of errors which occur during PHP\'s startup sequence are handled 469 ; separately from display_errors. PHP\'s default behavior is to suppress those 470 ; errors from clients. Turning the display of startup errors on can be useful in 471 ; debugging configuration problems. We strongly recommend you 472 ; set this to \'off\' for production servers. 473 ; Default Value: Off
将display_errors = Off改为On
[root@localhost php-fpm.d]# vi /usr/local/php-fpm/etc/php.ini /display_errors 462 ; Default Value: On 463 ; Development Value: On 464 ; Production Value: Off 465 ; http://php.net/display-errors 466 display_errors = On 467 468 ; The display of errors which occur during PHP\'s startup sequence are handled 469 ; separately from display_errors. PHP\'s default behavior is to suppress those 470 ; errors from clients. Turning the display of startup errors on can be useful in 471 ; debugging configuration problems. We strongly recommend you 472 ; set this to \'off\' for production servers. 473 ; Default Value: Off [root@localhost php-fpm.d]# /etc/init.d/php-fpm reload Reload service php-fpm done
[root@localhost php-fpm.d]# curl -x 127.0.0.1:80 test.com/sleep.php [root@localhost php-fpm.d]# cat /usr/local/php-fpm/var/log/www-slow.log
当前标题:【CentOS7LNMP架构38】,php-fpm慢执行日志#180110
转载来源:https://www.cdcxhl.com/article18/cpjidp.html
成都网站建设公司_创新互联,为您提供网站导航、网站收录、软件开发、动态网站、自适应网站、域名注册
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联