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!
Failed to parse dotenv file due to unexpected whitespace. Failed at [This will fail]. In this example it was caused by having unescaped whitespace in the APP_NAME field i.e. To fix, escape with quotes e.g.
This is a general error related to parsing the .env file. You'll see this is indicated in the error e.g. The environment file is invalid! Failed to parse dotenv file due to unexpected whitespace. Failed at [This will fail].
Also my site after updating to Laravel 5.8 is becoming a white blank page! Show activity on this post. This is a general error related to parsing the .env file. You'll see this is indicated in the error e.g. The environment file is invalid! Failed to parse dotenv file due to unexpected whitespace. Failed at [This will fail].
Secured Applications have an environment file that contains data for specific machine and software configurations like Database name and password, Email and password, value to tell if it's for development or production, etc. Laravel loads them in constant accessible via global function env () .
This is a general error related to parsing the .env file. You'll see this is indicated in the error e.g.
The environment file is invalid!
Failed to parse dotenv file due to unexpected whitespace.
Failed at [This will fail].
In this example it was caused by having unescaped whitespace in the APP_NAME
field i.e.
APP_NAME=This will fail
To fix, escape with quotes e.g.
APP_NAME="This is better"
This is general Error when we change our app name. To remove this error just do this.
APP_NAME=My Project Name
to this
APP_NAME="My Project Name"
You just need to add "" course around name. Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With