I have an EC2 with CentOS, cpanel and whm installed.
I have multiple accounts, linked with different subdomains. I have same php application deployed in the virtual hosts.
I need to use environment variables, with different values in for different virtual hosts.
For testing, I created a php file with
<?php echo getenv("MYVAR"); ?>
So far, I have tried setting the environment variables in
httpd.confeven though I'm not supposed to
.htaccessbecause I was desperate
EasyApache from whm.
apachectl -M shows
env_module (shared) though I'm not sure if its the same thing.
My userdata file just contained
SetEnv MYVAR myvalue, I could not find a single example whether this was right or wrong.
After that, I did
/scripts/ensure_vhost_includes --all-users and it added the
include statement in
httpd.conf. I restarted httpd service, it didnt help.
I even tried
/scripts/rebuildhttpdconf, it didnt help.