Skip to content

PHP-FPM doesn't write to error log

There are a few things you can try to troubleshoot this issue:

  1. Check the permissions of the error log file to make sure that the PHP-FPM process has write permissions. Verify that the exact user running the PHP-FPM worker (e.g., www-data, nginx, or apache) matches the log file owner.
  2. Check the PHP-FPM configuration file (usually php-fpm.conf or a pool file like www.conf) to make sure that the error log file is correctly configured. Note that PHP-FPM maintains two separate logs: the daemon log (FPM process itself) and the script log (PHP application errors). Configure them as follows:
    • Daemon log (php-fpm.conf): error_log = /var/log/php-fpm/error.log
    • Script log (pool file like www.conf):
      ini
      [www]
      php_admin_value[error_log] = /var/log/php-fpm/www-error.log
      php_admin_flag[log_errors] = on
  3. Check the PHP error log configuration in the PHP INI file (usually php.ini). Make sure that the error_log directive is set to the correct path and that the log file is writable by the PHP-FPM process.
  4. Restart the PHP-FPM service to apply any changes you have made.
  5. Check the system logs (e.g., /var/log/syslog on Ubuntu) or use journalctl -u php-fpm to see if there are any messages related to the PHP-FPM process or the error log file.
  6. If none of these steps help, you can try increasing the PHP-FPM logging level to see if it provides any additional information about the issue. You can do this by adding the following line to the global php-fpm.conf file: log_level = debug.

I hope this helps! Let me know if you have any other questions.

Dual-run preview — compare with live Symfony routes.