Issue
How to correctly configure the error_log and date.timezone to prevent overwriting?
Environment
CloudLinux OS 6(h)/7(h)/8
cPanel/Plesk/DirectAdmin/No panel
Solution
CloudLinux PHP Selector and its alt-PHP binaries get their default PHP options from /opt/alt/php*/etc/php.ini files. These files don't usually get overwritten upon alt-PHP packages updates.
However, there are two options that by-default can be changed when alt-PHP is updated: "error_log" and "date.timezone". On fresh installations, these options will be taken from the "native" php.ini file and populated to all /opt/alt/php*/etc/php.ini files. This can cause confusion when you want to modify this value in your global php.ini, but it will get overwritten again and again upon alt-PHP update.
To prevent this situation, you should define "error_log" and "date.timezone" options in /etc/cl.selector/global_php.ini file and run the following command to apply the changes:
cagefsctl --setup-cl-selector
You can define any configuration options in /etc/cl.selector/global_php.ini file. After you run the above command they will be applied to all alt-PHP versions. This command is also started upon CageFS and alt-PHP update. You can read our official documentation about assigning global PHP runtime configuration options here.
Comments
0 comments
Please sign in to leave a comment.