I have environment variables set in /etc/environment. printenv shows them. However, php-fpm isn't seeing them. I have uncommented clear_env = no in /etc/php-fpm.d/www.conf - this exposes SOME env vars to php-fpm (such as PATH), but none of those set in /etc/environment. Also, if I try to reference the /etc/environment environment variables in www.conf, like this: env[FOO] = $SOMEVAR (where SOMEVAR is set in /etc/environment), php has the envar FOO set to an empty value.
I'm by no means a Linux expert, but it seems to me that however php-fpm runs doesn't "use" the envars set in /etc/environment. Maybe? Please help.
Running Amazon Linux
THANKS! Adam
UPDATE:
sudo chkconfig --list php-fpm php-fpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off Dan, does that help? This is how php-fpm starts on reboot. Thanks!
/etc/environment?/etc/environmentis a PAM-specific thing that applies only to user sessions when they log in. I've also never seen a system where anyone has actually tried to use it for anything... For your current problem I would use Amazon Linux 2, and put your desired environment variables into a systemd override.