Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

htdung83's avatar

Laravel and Linux: env() the $value always return false

Hi guys,

I made a website using Laravel 5.3. The website works perfect on my laptop (localhost). I uploaded into a Linux hosting and I got the error "The only supported ciphers are AES-128-CBC and AES-256-CBC". I found that the problem was at env() function in helpers.php at line 435. The $value always return false that means the result of getenv($key) return false. But, it works good with Window, Wampserver 3 64bit.

I have googled to find the answer but found nothing. Is that the problem of Laravel with Linux server? Please help!

Thanks a lot. Tommy

0 likes
6 replies
jlrdw's avatar

Have you changed from dev to production in env? And I would hard code those configs in for production, don't use the env file.

htdung83's avatar

@jlrdw Thansk for your reply. I've try to change but nothing change. Why shouldn't I use env file?

htdung83's avatar

@jlrdw Yes I do. My .env file is OK. PHP ver of my hosting is PHP 5.6.16 while the requirement of Laravel 5.3 is PHP 5.6.4 It seems the getenv() function always return false.

janise's avatar

Try clearing cache (php artisan config:clear, php artisan cache:clear). It worked for me when I started to get false for all envs.

jbitfm's avatar

@janise Great, that worked. Thanks!

If anybody can explain why this happens and how to avoid, would be perfect. :-)

Please or to participate in this conversation.