我有两个服务器是Ubuntu 12.04和Ubuntu 14.04。 当我在新服务器中使用Ubuntu 14.04并启用在/etc/php5/fpm/php-fpm.conf中find的php-fpm日志文件,其内容如下:
error_log = /var/log/php5-fpm.log
我注意到,我在Ubuntu 12.04中find的大部分日志都不是在14.04中编写的。 例如,如果我重新启动我的Ubuntu 12.04中的php5-fpm,重新启动日志正在写入,但是,这不会发生在14.04。 我在14.04错过的另一个日志如下:
[23-Aug-2014 16:23:03] NOTICE: [pool web42] child 118098 exited with code 0 after 12983.480191 seconds from start [23-Aug-2014 16:23:03] NOTICE: [pool web42] child 147653 started [23-Aug-2014 17:27:31] WARNING: [pool web8] child 76743, script '/var/www/mysite.com/web/wp-comments-post.php' (request: "POST /wp-comments-post.php") executing too slow (12.923022 sec), logging
我真的想拥有这样的日志,所以我会知道一个缓慢的脚本已经执行的时间长度。
有没有人知道,除了/etc/php5/fpm/php-fpm.conf之外,我还需要更改Ubuntu 14.04中的其他设置吗?
更新:
这是我运行/etc/init.d/php5-fpm restart ; find / -type d -name /proc -prune -o -type f -mmin 2 -print时的结果/etc/init.d/php5-fpm restart ; find / -type d -name /proc -prune -o -type f -mmin 2 -print /etc/init.d/php5-fpm restart ; find / -type d -name /proc -prune -o -type f -mmin 2 -print :
find: warning: Unix filenames usually don't contain slashes (though pathnames do). That means that '-name `/proc'' will probably evaluate to false all the time on this system. You might find the '-wholename' test more useful, or perhaps '-samefile'. Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ `/proc''. /var/log/ispconfig/httpd/mysite.net/error.log /var/www/clients/client1/web4/web/wp-content/cache/page_enhanced/mysite.net/page/12-cool-hybrid/_index.html /var/www/clients/client1/web11/log/error.log /var/www/clients/client1/web11/tmp/sess_phi0akqc8k4r6pkqkg26im83i4 /var/www/clients/client1/web11/tmp/sess_vibcotqj4hht6u9boij9mufjs0 /var/www/clients/client1/web11/tmp/sess_lfdh2ol4hotpforolq693hvj70 /var/www/clients/client1/web11/tmp/sess_64slp06h69v35tg6nfq6u1uqm2
日志正在写入
./var/log/upstart/php5-fpm.log
这是可笑的讨厌find。
感谢Luigi(在评论中)指出了这一点。
检查你的php-fpm.conf并在下面的条目中注释
catch_workers_output = yes
重新启动所需的服务,并检查它为我工作。