Php-Fpm Doesn't Write to Error Log

PHP 7.2 - FPM - NGINX - Can't get a php error log outputted no matter what I do

Nginx logs are usually found in /var/log/nginx/. If you want to modify the filename/directory, you will need to modify the error_log directive in the site configuration file, in /etc/nginx/sites-enabled/ or /etc/nginx/sites-available (same file, the sites-enabled files are linked to the same file in the /etc/nginx/sites-available folder)

php-fpm one error log file per pool

Hope my answer will save someone a day of googling.

- Make sure you have the correct permissions of the folder your logs reside.

- Also make sure the user your pool runs as has the rights to write into the log file you specified in the settings of the pool.

Credits go to the user frozen_twilight from this thread:
https://www.linux.org.ru/forum/admin/9598568?lastmod=1440115408848#comment-9600057

P.S.

In my case php-fpm pool process has been unable to write to the log dir and into the file due to the changed defaults in the php 5.6.

I had stopped the php-fpm service before trying to update php. During the update my php-fpm.conf has got renamed and the new one (with new defaults) has been installed, so the first run the updated php-fpm pool has started as php-fpm user and not as apache, as it had been set up before the update.



Related Topics



Leave a reply



Submit