Env variable can't be read by laravel

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?
No description
Solution:
Mine was raw php, I was using getenv() and $_ENV to get the env vars, but the correct way was using $_SERVER
Jump to solution
9 Replies
Percy
Percy10mo ago
Project ID: aa2a5d94-9bd2-48c1-9fc2-09c09a301603
fikurimax
fikurimax10mo ago
project id: aa2a5d94-9bd2-48c1-9fc2-09c09a301603
Brody
Brody10mo ago
@Medim - I'm pretty sure you've faced this issue before right? could you lend a hand here? (silent ping failed me)
Solution
Medim
Medim10mo ago
Mine was raw php, I was using getenv() and $_ENV to get the env vars, but the correct way was using $_SERVER
Medim
Medim10mo ago
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)
fikurimax
fikurimax10mo ago
so is there any workaround?
Brody
Brody10mo ago
please read medim's message
fikurimax
fikurimax10mo ago
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!
Medim
Medim10mo ago
just replace all salute
Want results from more Discord servers?
Add your server