I switched to using PHP-FPM as the default PHP handler for my servers. Works great!
However, previously when using the default CGI handler, PHP error logs resided in the same directory as the PHP file that created the error. This was a very useful setup to me. With PHP-FPM the default error log location is at: /home/username/logs/domain_tld.php.error.log
I'd like to change this so that error logs are created again in the same directory as the PHP file that caused the error.
This seems a bit harder to achieve than I anticipated. I thought all I had to do is change the PHP-FPM configuration so that error log location is set to simply a the file name, without any slashes.
I've added the following line blow to /var/cpanel/userdata/user/domain.php_fpm.yaml file and ran /usr/local/cpanel/scripts/php_fpm_config --rebuild.
php_admin_value_error_log: { name: 'php_admin_value[error_log]', value: "error_log" }
This successfully changed the error log value in the PHP configuration to error_log. Unfortunately however still no error_log file is created in the same directory as the PHP file that caused the error. Also errors aren't logged to the /home/username/logs/domain_tld.php.error.log location.
So ... what am I missing? How do get a error log files created in the same directory as the PHP file that caused the error?
However, previously when using the default CGI handler, PHP error logs resided in the same directory as the PHP file that created the error. This was a very useful setup to me. With PHP-FPM the default error log location is at: /home/username/logs/domain_tld.php.error.log
I'd like to change this so that error logs are created again in the same directory as the PHP file that caused the error.
This seems a bit harder to achieve than I anticipated. I thought all I had to do is change the PHP-FPM configuration so that error log location is set to simply a the file name, without any slashes.
I've added the following line blow to /var/cpanel/userdata/user/domain.php_fpm.yaml file and ran /usr/local/cpanel/scripts/php_fpm_config --rebuild.
php_admin_value_error_log: { name: 'php_admin_value[error_log]', value: "error_log" }
This successfully changed the error log value in the PHP configuration to error_log. Unfortunately however still no error_log file is created in the same directory as the PHP file that caused the error. Also errors aren't logged to the /home/username/logs/domain_tld.php.error.log location.
So ... what am I missing? How do get a error log files created in the same directory as the PHP file that caused the error?