How to setup environment variables
I am setting up a symfony 3 application, and I need to setup a few environmental variables.
I tried adding them in a profile.d script. This made them available on SSH shell, but php still cannot get them
I am running Centos 7.3 and WHM/cpanel 64.0, while easy apache is set with php 7.1.3 and php-fpm
Thanks in advance for your time
-
Hi, Try the below: # cd ~ # touch .bash_exports # vi .bash_exports Put your environmental variables in here.. # vi .bashrc Add the below bold statement in the .bashrc file. if [ -f $HOME/.bash_exports ]; then . $HOME/.bash_exports fi 0 -
Thanks for the response I have already tried this but unfortunately, it does not work. .bashrc is executed when you start bash as a user, so you will have those when using SSH for example. But apache and php-fpm still have no way of knowing those variables. 0 -
Hello, Could you provide some more information about the specific environmental variables you need to configure? There's a thread here you may find helpful: How to use php-cli 7.X instead 5.6 Thank you. 0
Please sign in to leave a comment.
Comments
3 comments