1

I have custom environment variables being set in the php.ini file. I want to override those values in the user.ini (to show different things based on this env on heroku) or fpm_custom.conf file but I cant seem to get the combination / syntax right.

In the php.ini file

  • env_mode = "Production"

In the user.ini file

env_mode = "Development"

In the Procfile

web: vendor/bin/heroku-php-apache2 -F fpm_custom.conf www/

In the fpm_custom.conf file

??? Here's where I want to set env_more

I've tried

  • ENV_MODE = "Development"
  • php_value[ENV_MODE]=Development
  • php_value ENV_MODE Development

Any help would be great! Thanks

1 Answer 1

1

I believe what you are looking for is:

env[ENV_MODE] = Development

Then you can use getenv('ENV_MODE'); or $_ENV['ENV_MODE'] in PHP.

That needs to go in your PHP-FPM pool config file (the one in pool.d by default).

This sets a PHP environment variable. php_value doesn't set an environment variable, but rather is used to set php.ini directives. So using php_value ENV_MODE has no effect.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.