PHP-FPM service logs
The PHP-FPM service is the master process of PHP’s FastCGI Process Manager (FPM). Each PHP version has its own PHP-FPM service.
View the logs
A server’s PHP-FPM service logs can be viewed from within the ServerPilot dashboard or through SSH.
Log file location
The PHP-FPM service logs can be accessed at the following paths
while logged into a server as root
.
/var/log/php8.4-fpm-sp.log
/var/log/php8.3-fpm-sp.log
/var/log/php8.2-fpm-sp.log
/var/log/php8.1-fpm-sp.log
/var/log/php8.0-fpm-sp.log
/var/log/php7.4-fpm-sp.log
/var/log/php7.3-fpm-sp.log
/var/log/php7.2-fpm-sp.log
/var/log/php7.1-fpm-sp.log
/var/log/php7.0-fpm-sp.log
/var/log/php5.6-fpm-sp.log
Log file format
The format of PHP-FPM service log entries depends on whether the log entry is related to the PHP-FPM service itself or whether the log entry is related to a specific app’s PHP-FPM pool.
For log entries related to the PHP-FPM service itself, the log format is:
[DATE_TIME] LOG_LEVEL: LOG_MESSAGE
For log entries related to a specific app’s PHP-FPM pool, the log format is:
[DATE_TIME] LOG_LEVEL: [pool APPNAME] LOG_MESSAGE
Both formats of log entries can be seen in the following example log entries:
[05-Mar-2025 17:33:05] WARNING: [pool example] child 320808, script '/srv/users/example/apps/example/public/wp-admin/admin-ajax.php' (request: "POST /wp-admin/admin-ajax.php?action=wp_gf_feed_processor") executing too slow (5.588836 sec), logging[05-Mar-2025 17:33:05] NOTICE: child 320808 stopped for tracing[05-Mar-2025 17:33:05] NOTICE: about to trace 320808[05-Mar-2025 17:33:05] NOTICE: finished trace of 320808
The above example shows the log entries created in the PHP-FPM service log when a request’s execution time exceeds five seconds and a stack trace of the executing script is logged to the app’s PHP slow request log.
Example commands
You must be logged in as root
to view the PHP-FPM service log.
Count slow requests
sudo grep -c -F "executing too slow" /var/log/php*-fpm-sp.log
View apps and script file names of slow requests
sudo grep -F "executing too slow" /var/log/php*-fpm-sp.log