Cannot turn off logging to php.error.log
I tried to turn off error logging to /logs/#domain#php.error.log with cpanel's multi php manager for a particular account but without luck. These are the new entries set in cpanel multi php manager:
display_errors = Off
error_reporting = Off
error_log = ""
/logs/php.error.log file is still created (containing a lot of strict warnings etc.) and incresing the account's size.
How can I completely stop the creation of php.error.log file for that particular account?
-
Hello @triatlas It sounds like this is a domain using PHP-FPM and modifications to PHP-FPM's user pools need to be managed outside of the MultiPHP manager. The following should provide instructions on how to make the necessary modifications: Configure or Disable PHP-FPM with User Pools for EasyApache 4 - cPanel Knowledge Base - cPanel Documentation 0 -
Hello @cPanelLauren the file /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml does not contain any global values. The file /var/cpanel/userdata/#account#/#domain#.php-fpm-yaml contains: --- _is_present: 1 pm_max_children: 5 pm_max_requests: 20 pm_process_idle_timeout: 10 php_admin_value_log_errors: { name: 'php_admin_value[log_errors]', value: off } php_admin_value_error_log: { name: 'php_admin_value[error_log]', value: } I added the last two lines now but errors are still logged to the php.error.log file in the user's account. The presence of _is_present: 1 should "activate" the values set in php.ini / .user.ini of the user's account anyway, shouldn't it? Am I missing something? 0 -
Hi @triatlas the file /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml does not contain any global values.
This file should be empty or not exist at the beginning of this and this is where you would store global values. User specific values would be modified in the yaml at/var/cpanel/userdata/$user/$domain.tld.php-fpm.yaml
Here's what I did exactly: 1. I went to /var/cpanel/cd /var/cpanel
and created the directory ApachePHPFPMmkdir ApachePHPFPM
as well as the file system_pool_defaults.yamltouch system_pool_defaults.yaml
with the contents as follows:[root@server ApachePHPFPM]# cat system_pool_defaults.yaml --- php_admin_flag_log_errors: {name: 'php_admin_flag[log_errors]', value: off }
I added everything including the --- which are actually required in the file. Then once that was complete I ran:/scripts/php_fpm_config --rebuild
Which rebuilds the apache config Then I restarted php-fpm:/scripts/restartsrv_apache_php_fpm
and lastly restarted apache:/scripts/restartsrv_httpd
Once all was completed the PHP error logs in the user's /home/$user/logs/ directory ceased to be populated I fully understand that this is extremely confusing if you're not familiar with the configuration and even a bit to some that are. To correct this we are adding an GUI in a future release of cPanel (I believe it's slated for v78)0 -
Hello @cPanelLauren thank you for the detailed description. I managed to disable the writing to php.error.log file for all users. How would the workflow be if I only want to disable it for just one particular user? This is what I initially intended. Thanks. 0 -
Hi @triatlas So instead of modifying the system_pool_defaults.yaml you'll edit /var/cpanel/userdata/$user/$domain.tld.php-fpm.yaml
Thanks!0
Please sign in to leave a comment.
Comments
5 comments