Understanding PHP Error Logs and Php-fpm Error Logs and Nginx Error Logs

Asked 2 years ago, Updated 2 years ago, 87 views

Why are PHP error logs divided into multiple files?
·/var/log/php-fpm/
·/var/log/nginx/

Is the following php-fpm error log?
·Different from PHP error log?

$sudoless/var/log/php-fpm/error.log-20190428
[22-Apr-2019 04:08:06] NOTICE: error log file re-opened [23-Apr-2019]
13:36:35] WARNING: [pool www] sees busy (you may need to increase)
pm.start_servers, or pm.min/max_spare_servers), spawning8children,
there are 0 idle, and 42 total children [23-Apr-2019 13:36:36]
WARNING: [pool www] sees busy (you may need to increase)
pm.start_servers, or pm.min/max_spare_servers), spawning16children,
there are 0 idle, and 47 total children [23-Apr-2019 13:36:39]
WARNING: [pool www] server reached pm.max_children setting (50),
consumer raising it

I think the following is a normal PHP error log.
·Why is it printed in nginx file (not PHP file)?

$sudoless/var/log/nginx/error.log-20190430
PHP message:PHP Notice:Undefined variable:individual in

environment
·CentOS
·Nginx
·PHP7

php nginx

2022-09-30 14:03

1 Answers

PHP can be run as a single script (from the command line), where the error output is standard error output or any log file that you specify in the script.

The /var/log/nginx/ output appears when PHP is run as CGI via Nginx (although strictly speaking, there is a modular version, but it is omitted).

/var/log/php-fpm/ displays when running PHP using FastCGI (FPM), FastCGI (FastCGI).


2022-09-30 14:03

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.