Back

Disabled function putenv()


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).

Xum replied 4 years ago 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.

Adam replied 4 years ago

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!


Sign in to participate in this thread!



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