Laravel 5.2 not reading env file

前端 未结 26 2172
时光说笑
时光说笑 2020-11-28 20:52

After upgrading to Laravel 5.2, none of my .env file values are being read. I followed the upgrade instructions; none of my config files were changed except aut

26条回答
  •  無奈伤痛
    2020-11-28 21:33

    From the official Laravel 5.2 Upgrade Notes:

    If you are using the config:cache command during deployment, you must make sure that you are only calling the env function from within your configuration files, and not from anywhere else in your application.

    If you are calling env from within your application, it is strongly recommended you add proper configuration values to your configuration files and call env from that location instead, allowing you to convert your env calls to config calls.

    Reference: https://laravel.com/docs/5.2/upgrade#upgrade-5.2.0

提交回复
热议问题