Can't access new environment variable via PHP

php
environment

#1

I’ve set a new variable using the “.bashrc” file. The variable is show at the terminal but I can’t access it using the “getenv()” function with php (it works with other variables that were already there, like “C9_USER” or “PORT”).


#2

by default bashrc has a check for running in the interactive mode (see return somewhere in the middle)
Variables added after return will be available only in the terninal. Move the definition higher to access it from output pane


#3

Thanks! It worked like a charm.