How do I use environmental variables for my wp-config.php? Where do I set these variables?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hello @mlmarinas,
Can you please share what your end goal is? I’m not entierly sure what you mean by the above question but I’ll give it a try to answer as best to my knowledge as possible.
When you mention environmental variables with Nginx, all I can think is about environments that are added in PHP-FPM. You can set the environment variable in
/etc/php/php-fpm.d/www.conf
like this:Then you’ll be able to get it with getenv(‘APP_ENV’) anywhere on your PHP application, as long as you are using that php-fpm instnace.
Is that what you were after?
Regards, KFSys