Menu

#9 Enviornment variables .ENV conflict

1.0
open
nobody
None
2015-04-03
2015-04-02
dna motors
No

I'm experiencing some odd conflict between projects lately.

Basically I have these variables in my .ENV:

DB_HOST DB_DATABASE DB_USERNAME DB_PASSWORD

Let's say I have 2 projects both have the same enviornment variables but totally different projects/folders.

When one project is accessing the database the 2nd project that attempts to access the database will attempt to connect to the first project's credentials.

Both databases are also different. I've tested it by purposely putting them on 2 different servers but that didn't solve it.

Once the first project is done accessing the database, the 2nd project is now working again.

I tested this theory by changing the 2nd project .ENV variables to:

DBHOST DBDATABASE DBUSERNAME DBPASSWORD

And it worked both at the same time.

For reference I found a similar situation here: https://laracasts.com/discuss/channels/tips/environmental-variables-mixture

Just a bit confused what's really happening here. Hope projects can use the same ENV variables since it should be treated as separate.

Thanks.

Discussion

  • Leo Khoa

    Leo Khoa - 2015-04-03

    I wish I could help you but this is related to how PHP handle environment variables.

     
  • dna motors

    dna motors - 2015-04-03

    Okay for now I will just prefix the ENV variables can't think of any other way. THanks anyways.

     

Log in to post a comment.