Support the ongoing development of →
Laravel Encryption
Last updated by @gautam071 1 year ago.
moderator Solution

Hello @gautam071

It is possible to set the environment variable without the .env file. You need to set environments variable on your server but that depends on your system. It is the same idea as if you run env in your Linux shell.

In PHP you can see the variables with $_ENV (See: ) And if I'm correct Laravel will load the variables for you like the .env file.

On the other hand if someone has access to your production server he/she can not only read the .env file but also probably also access your env variable.

Maybe can encrypting your environment variable be interesting for you:

gautam071 liked this reply

Solution selected by @driesvints

Hi @tvbeek

Thanks for sharing!

I will look into the reserved variables in PHP and I will try it out in my system.

tvbeek liked this reply


Sign in to participate in this thread!


Your banner here too?

Gautam gautam071 Joined 12 Jan 2023


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.