dimkasta

Registered
Aug 14, 2013
2
0
1
cPanel Access Level
Reseller Owner
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
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
97
78
India
cPanel Access Level
Root Administrator
Twitter
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
 

dimkasta

Registered
Aug 14, 2013
2
0
1
cPanel Access Level
Reseller Owner
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
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.