How do you configure PHP fpm logs?
To configure PHP-FPM logs, you can follow these steps:
- Open the PHP-FPM configuration file. By default, this file is located at /etc/php/{version}/fpm/pool.d/www.conf. You can use any text editor to open this file.
- Search the following lines:
- error_log = log/php-fpm.log
- Remove the semicolon at the beginning and change the path to where you want to save the log file. For example:
- /var/log/php-fpm.log is the location of the error log.
- Save and close the configuration file.
- Restart the PHP-FPM service to apply the changes. You can use the following command to restart the service:
- Restart the php-fpm service using sudo.
At this point, PHP-FPM will start writing errors and other log information to the specified log file.