After nginx and php are configured, no logs are found for php-error. Google finally got it done, mainly to the php-fpm.conf and php. ini to make the following changes:
1. Modify php-fpm.conf
Modifying the worker process configuration for www. conf under the pool. d may also be to output the error message. By default, the error log of the worker process is redirected to/dev/null.
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; Stderr will be redirected to/dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; Process time (several MS ).
; Default Value: no
Catch_workers_output = yes
2. Modify the configuration in php. ini.
Modify the configuration in php. ini to prevent php from outputting error information to the webpage, but to the file system.
Display_errors Off
Log_errors On
Error_log/var/log/php/php_errors.log
Now the configuration is complete, but note that the worker process of php-fpm must have the write permission for log files. Check the owner of the php-fpm worker process.
Ps aux | grep php-fpm
For example, in my system, the owner of the php-fpm master process is root, and that of the php-fpm worer process is www-data, for me, you only need to set the owner and group of the directory/var/log/php/To www-data.