
Apache 2.4 virtual host specific PHP-FPM error logs
If you are using PHP-FPM with Apache and you would like to separate the error logging by user, directory or virtual host, you can use the ProxyFCGISetEnvIf directive
In a server level Apache .conf file
<Directory /home/user/public_html>
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "error_log=/var/log/php-fpm/user/error.log"
</Directory>
In this case, the error log for user would be
/var/log/php-fpm/user/error.log
Set up the ACL (AMI 2 Linux)
setfacl -m u:user:x /var/log/php-fpm
setfacl -m u:user:rx /var/log/php-fpm/user
setfacl -d -m u:user:r /var/log/php-fpm/user
Test it with
sudo su user
more /var/log/php-fpm/user/error.log
Credit to:
https://www.php.net/manual/en/install.fpm.configuration.php#123335
Print article | This entry was posted by elvis on 07/13/20 at 09:11:00 pm . Follow any responses to this post through RSS 2.0. |