Issue : Trying to Access EC2 Variables for whole server.


I am trying to define certain variables on my EC2 to use on my site. I have created an environment file in etc , .htaccess and also tried in php.ini. I see these new variables when i type printenv on the server but when I print phpinfo() on my site i do not see these variables. Any ideas why they are not being shown please?

已提问 1 年前266 查看次数
2 回答

HI - What are these values? are custom like using SetEnv with key value pair. Any example of EC2 Variables that you are trying to use?

profile pictureAWS
已回答 1 年前
  • Hi, Thanks for responding, I am trying to pass DB Variables to use in a configuration file of my site. I have managed to do it for apache by using SetEnv however I'm having an issue for nginx. I have tried to use fastcgi_param DB_NAME value but cannot access the variable using $_SERVER['DB_NAME']; How can I output the variable ? or fastcgi_param isn't the right way ?


Any feedback please ?

已回答 1 年前

您未登录。 登录 发布回答。