Sending errors to syslog in php-fpm


I'm trying to setup an php-fpm daemon to send error_log to syslog.

My config php-fpm.conf looks thereby.

error_log = syslog
syslog.facility = local4
syslog.ident = php-fpm

Restarting php-fpm daemon I can see in the remote syslog server.

Mar 22 00:32:08 php-fpm[20919]: [NOTICE] configuration file /etc/php5/fpm/php-fpm.conf test is successful


But when I test this with a real php script with errors, message change to..

Mar 22 00:05:59 ool www[20889]: PHP Parse error:  syntax error, unexpected ''api'' (T_CONSTANT_ENCAPSED_STRING) in /var/api/public/index.php on line 2

ool www is pool + default pool name (www). So two questions:

  • Why I see ool www instead of php-fpm (syslog.ident value)?
  • Why is pool title is truncated?



I think its a PHP bug :( See please




This issue will become more prevalent as we start to upgrade older systems to php 5.5+, so posting for future reference.

Here is the fix we used, put it as low level as you can so all your scripts can benefit:

// This was needed for upgrade to php5.5+ with php-fpm
//  Source:
//  Bug History:
openlog('php', LOG_ODELAY, LOG_USER);

People are also looking for solutions to the problem: mysql - Trying to display my products in my netbeans php project


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.