0

I am trying to get the heroku variable in PHP.I have been defined the variable in heroku.But the problem is I am not able to access those variable.

I have checked the variable in web and also console..The variable is there.But in PHP it shows empty.Anything need to be do in the composer or vendor?

enter image description here

enter image description here

In views file i tried like:

getenv('VIDEO');

But this is empty.Please help.

i already checked these links:

  1. Use Heroku config vars with PHP?

  2. https://devcenter.heroku.com/articles/deploying-php

lalithkumar
  • 3,480
  • 4
  • 24
  • 40

1 Answers1

2

There is Procfile in vendor/bin/heroku-php-apache2..If that file is there then that config var function works.

$config_var = getenv('CONFIG_VAR');

Sorry I was checking in localhost after clone from heroku.In localhost procfile file is not there.That is why that did not work.In heroku application that file exist.It works in heroku app.

lalithkumar
  • 3,480
  • 4
  • 24
  • 40