ScottGoddard
Basic Pleskian
I use PHP Additional Configuration Directives (within the PHP settings page of the site) to set various environment variables that are unique to that site/domain/sub-domain.
As an example, I can use the following to set whether the site is dev, test, or prod, which allows me to keep one code base that behaves correctly for its environment:
I can use this to securely set other site specific variables.
This works great...until you have to sync the subscription - at which point all PHP Additional Configuration Directives are removed. Even just changing the subscription expiry date then requires a resync, resulting in the loss of the environment variables.
I am aware I could set up a custom subscription or an 'add on' to achieve this (as pointed out here: Issue - Additional configuration directives in PHP Settings are overwritten during a service package synchronization) but doing this for every single domain and sub domain this seems ludicrously long winded and complicated way to achieve what should be simple.
Am I missing something obvious? Please don't suggest .env files as these can be a pain and are easily mishandled (yes, I know that `env[APP_ENV]` can also be mishandled and revealed if care is not taken, but I find them more secure, easier to work with, more robust and just all round better.)
As an example, I can use the following to set whether the site is dev, test, or prod, which allows me to keep one code base that behaves correctly for its environment:
Code:
[php-fpm-pool-settings]
env[APP_ENV] = prod
I can use this to securely set other site specific variables.
This works great...until you have to sync the subscription - at which point all PHP Additional Configuration Directives are removed. Even just changing the subscription expiry date then requires a resync, resulting in the loss of the environment variables.
I am aware I could set up a custom subscription or an 'add on' to achieve this (as pointed out here: Issue - Additional configuration directives in PHP Settings are overwritten during a service package synchronization) but doing this for every single domain and sub domain this seems ludicrously long winded and complicated way to achieve what should be simple.
Am I missing something obvious? Please don't suggest .env files as these can be a pain and are easily mishandled (yes, I know that `env[APP_ENV]` can also be mishandled and revealed if care is not taken, but I find them more secure, easier to work with, more robust and just all round better.)