0

I have a Laravel 5 application that works perfectly on multiple servers. But on a specific Server, the values of my .env file are not readable via the \Config facade, or the config() function.

Let me give an example with the APP_DEBUG environment entry, the same goes for all other entries.

My .env file (the same on all servers) consists, amongst others, of the following line:

APP_DEBUG=false

through the use of $app->environmentFile() I know, that my .env file is used.

When I directly output the debug param via env('APP_DEBUG'), I get the correct value (false), but all approaches to read the value from the config (\Config::get('app.debug'), config('app.debug'), app('config')->get('app.debug')) only returned NULL.

I also tried to clear the cache via artisan cache:clear, because I thought, there could be some caching issue, but that didn't change a thing.

I also tried set the permissions of the .env file to 777.

When I output my whole config via \Config::all(), all values that are correctly set on my other servers, are NULL on this specific server.

Any suggestions?

Edit for clarification: The project is set up twice on the same server on two different Virtual hosts, one to serve the dev.domain.tld (for development), and one to serve the www.domain.tld (for production). Both folders use the same webserver, the same PHP version and the same user

miken32
  • 42,008
  • 16
  • 111
  • 154
Stefan S
  • 650
  • 2
  • 10
  • 23
  • Could you be more specific about this "specific server"? :) Anyway, it's hard to say something for sure with no insight in the code and setup. All I can think of is differences in the setup of the project or specifics of the server that fails to load config values. – lesssugar Jul 08 '15 at 19:54
  • I don't get it. Config file and env are different things. Did you declared `debug` key at `config.php` file? – manix Jul 08 '15 at 20:15
  • Looks like the other servers has cached the values instead – manix Jul 08 '15 at 20:15
  • @manix of course, the `debug` key is declared inside the `config/app.php` file as `'debug' => env('APP_DEBUG')`. but the call of the `env('APP_DEBUG')` functions works inside the app – Stefan S Jul 08 '15 at 20:27
  • @lesssugar sorry for providing too less information. I have updated my question – Stefan S Jul 08 '15 at 20:34

0 Answers0