#Env variable can't be read by laravel

10 messages · Page 1 of 1 (latest)

summer pulsar
#

I've deployed my Laravel app and already set the env vars, but when I checked the log it can't read the env. Can someone help me?

agile parcelBOT
#

Project ID: aa2a5d94-9bd2-48c1-9fc2-09c09a301603

summer pulsar
#

project id: aa2a5d94-9bd2-48c1-9fc2-09c09a301603

silver holly
#

@latent tree - I'm pretty sure you've faced this issue before right? could you lend a hand here? (silent ping failed me)

latent tree
#

Mine was raw php, I was using getenv() and $_ENV to get the env vars, but the correct way was using $_SERVER

#

Why? good question, i'm not that good with PHP I just mantain an archaic codebase but my guess is that it is 'cause the envs are provided by railway (the server, instead of a client session)

summer pulsar
#

so is there any workaround?

silver holly
#

please read medim's message

trim yarrowBOT
summer pulsar
#

Iam using laravel framework, changing getenv() or $_ENV will not be only in one place. But ok if that's the only solution for now, thanks!