Search code examples
shared-hostinglaravel-5.8laravel-artisanphpdotenv

Laravel 5.8 , artisan commands error : Failed to parse dotenv file due to an invalid name


This problem only happens with Laravel 5.8 on my shared hosting.

It is working fine in my shared hosting with Laravel 5.7.

It is working fine in my local environment with Laravel 5.8.

the problem is:

every time I run php artisan commands (on my shared hosting with Laravel 5.8 only) I got this error

The environment file is invalid! Failed to parse dotenv file due to an invalid name.

Failed at [APP_NAME].

my .env first line is : APP_NAME=rased

Also my site after updating to Laravel 5.8 is becoming a white blank page!


Solution

  • I found the cause of this problem.

    It was because of line separator in .env file !

    It must be CRLF not LF

    My .env file was LF

    see the screenshot to understand the solution