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
Jquery Ajax Form Using Mail() PHP Script Sends Email, But Post Data from HTML Form Is Undefined
How to Fetch All in Assoc Array from a Prepared Statement
Preg_Match(); - Unknown Modifier '+'
PHP Technique to Query the Apns Feedback Server
Bounce Email Handling with PHP
Replacing MySQL_* Functions with Pdo and Prepared Statements
How to Read Only 5 Last Line of the Text File in PHP
Post and Get at the Same Time in PHP
How to Sort an Array of Utf-8 Strings in PHP
Convert Ascii to Utf-8 Encoding
How to Detect an Incoming Request (With PHP Script) from a Cname Subdomain
Post Content-Length Exceeds the Limit