Support the ongoing development of Laravel.io →
Security Requests Forms

Hello, I've encountred a problem with my Laravel application. I'm developing a simple application with few forms in whole project and everything worked just fine on my local machine. However, when I deployed my app on a public server, I'm getting warnings over the whole page, something like this:

Warning: putenv() has been disabled for security reasons in /data/web/virtuals/98646/virtual/www/vendor/vlucas/phpdotenv/src/Dotenv.php on line 75

And the main problem, whenever I try to post a form, i get an error TokenMismatchException, what I believe is caused by disabled putenv().

Is there any way, how to fix it? Or maybe bypass it? (Provider will not enable putenv() function).

Last updated 3 years ago.
0
Solution

You could try to move your settings from .env file to respective config files in config directory and delete the .env file.

You probably will only need to move APP_KEY value to config/app.php (and maybe enable debug, if you need it); and DB_* values to config/database.php.

0

Xum said:

You could try to move your settings from .env file to respective config files in config directory and delete the .env file.

You probably will only need to move APP_KEY value to config/app.php (and maybe enable debug, if you need it); and DB_* values to config/database.php.

Thanks a lot!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Adam adam Joined 16 Apr 2015

Moderators

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

Your logo here?

Laravel.io

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

© 2025 Laravel.io - All rights reserved.