6

I have two servers which is Ubuntu 12.04 and Ubuntu 14.04. When I use Ubuntu 14.04 in my new server and enabled the php-fpm log file found under /etc/php5/fpm/php-fpm.conf that reads as follows:

error_log = /var/log/php5-fpm.log

I noticed that most of the log that I found in Ubuntu 12.04 is not written in 14.04. For example, if I restart php5-fpm in my Ubuntu 12.04, a restart log is being written, however, this does not happen in 14.04. Another log which I missed in 14.04 are the following:

[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

I really wanted to have this kind of log so I will know the length of time a slow script has executed.

Does anyone know if there are other settings in Ubuntu 14.04 that I need to change in addition to /etc/php5/fpm/php-fpm.conf?

Update:

This is the result when I run /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
jaypabs
  • 823
  • 2
  • 10
  • 15

2 Answers2

9

The log is being written to

    ./var/log/upstart/php5-fpm.log

This was ridiculously annoying to find.

Thanks to Luigi (in the comments) for pointing this out.

caruizdiaz
  • 106
  • 1
  • 3
1

Check your php-fpm.conf and comment below entry

catch_workers_output = yes

Restart desired services and check it worked for me.

Pratap
  • 695
  • 6
  • 22
  • Hi. I can't find this settings (`catch_workers_output = yes`) in php5-fpm.conf. There is settings in www.conf under pool.d/www.conf but it was commented in v12.04. Which I think it's not also necessary to be commented out in v14.04. – jaypabs Aug 24 '14 at 12:44
  • you can add then and restart the services. – Pratap Aug 24 '14 at 14:49
  • I tried to uncomment the `catch_workers_output = yes` under www.conf without lack. No notices or warning messages is logged in php-fpm.log file. – jaypabs Aug 29 '14 at 06:35
  • 1
    Can you give me the log file name which you are checking with the location?Also as per the conf file description, by default it writes the log to file **"/usr/local/php/var/log/php-fpm.log"**. [**error_log string Path to error log file. Default value: #INSTALL_PREFIX#/log/php-fpm.log.**](http://php.net/manual/en/install.fpm.configuration.php) – Pratap Aug 29 '14 at 20:28
  • The log file is saved here `/var/log/php5-fpm.log`. – jaypabs Aug 29 '14 at 22:35
  • Try this it must give you some clue: **/etc/init.d/php-fpm restart ; find / -type d -name /proc -prune -o -type f -mmin 2 -print** If this is not giving you any clue then seems to be issue with your installation verify again and check. – Pratap Aug 30 '14 at 07:32
  • Please look at the update for the result of your command. Additionally, I'm confused which config file this command `catch_workers_output = yes` should be added. Is it in `www.conf` or `php-fpm.conf`? – jaypabs Aug 30 '14 at 14:46
  • Check the log **"/var/www/clients/client1/web11/log/error.log" or "/var/log/ispconfig/httpd/mysite.net/error.log"** – Pratap Aug 30 '14 at 15:03
  • You should add it in "php-fpm.conf" **grep catch_workers_output /usr/local/php/etc/php-fpm.conf catch_workers_output = yes** and **grep error_log /usr/local/php/etc/php-fpm.conf error_log = log/php-fpm.log** – Pratap Aug 30 '14 at 15:32
  • I added `catch_workers_output = yes` in `/etc/php5/fpm/php-fpm.conf` and my website is not accessible anymore. Are you sure it should be under `php-fpm.conf`? – jaypabs Aug 31 '14 at 04:12