Multiplay Labs

tech hits and tips from Multiplay

Logging php errors when using php-fpm

without comments

When moving to using php-fpm to serve pages via nginx from apache, its not very obvious how to see errors logged via the php function error_log, so I thought I’d post how to do it here so others don’t have to do quite a much searching as I did.

Its really simple just ensure both the following php variables are set:

  • error_log
  • log_errors

This can be done either in the php.ini but the method I prefer is setting it up in php-fpm.conf e.g.

<?xml version="1.0" ?>
<configuration>
  <workers>
    <section name="pool">
      <value name="php_defines">
        <value name="error_log">/var/log/php-error.log</value>
        <value name="log_errors">true</value>
      </value>
    </section>
  </workers>
</configuration>

Written by Dilbert

September 13th, 2009 at 8:22 pm

Posted in Hackery,Performance

Leave a Reply

You must be logged in to post a comment.