Is there a best practice for managing php.ini configurations from development to production? Obviously it can be done manually, but that is prone to human error. I’d like to try and have the production file in version control and then possibly modify the development version automatically.
Thoughts or ideas i’ve had which i dont know if they are feasible:
- php.ini includes – just include the dev settings at the end of
the file? - conditional loads from apache conf?
- write a script that when php.ini changes, a dynamic version of phpdev.ini gets generated – (i know this can be done)
- use runtime php settings for display errors – i think this has limitations because if the script has fatal errors, then it wont run the runtime setting.
- backup plan – keep the production version in SC, and manually change
phpdev.ini as needed as needed. Then if manual mistakes are made
they are done at the development level.
rm /etc/php.ini; ln -s /var/www/site/environments/prod/php.ini /etc/php.iniThis way, you get the benefits of revision control and don’t necessarily have to edit each manually.