How do you configure PHP fpm logs?

To configure PHP-FPM logs, you can follow these steps:

  1. 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.
  2. Search the following lines:
  3. error_log = log/php-fpm.log
  4. Remove the semicolon at the beginning and change the path to where you want to save the log file. For example:
  5. /var/log/php-fpm.log is the location of the error log.
  6. Save and close the configuration file.
  7. Restart the PHP-FPM service to apply the changes. You can use the following command to restart the service:
  8. 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.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds