这个问题只发生在我的共享主机上的 Laravel 5.8 上。
它在我与 Laravel 5.7 的共享主机中运行良好。
它在我的本地环境中使用 Laravel 5.8 运行良好。
问题是:
每次我运行 php artisan 命令(仅在我与 Laravel 5.8 的共享主机上)时,我都会收到此错误
The environment file is invalid! Failed to parse dotenv file due to an invalid name.
Failed at [APP_NAME].
我的 .env 第一行是:
APP_NAME=rased
更新到 Laravel 5.8 后,我的网站也变成了一个白色的空白页面!
最佳答案
这是与解析 .env 文件相关的一般错误。
您会在错误中看到这一点,例如
The environment file is invalid!
Failed to parse dotenv file due to unexpected whitespace.
Failed at [This will fail].
在这个例子中,它是由
APP_NAME
中的未转义空格引起的。领域,即APP_NAME=This will fail
要修复,请使用引号转义,例如
APP_NAME="This is better"
关于shared-hosting - Laravel 5.8,工匠命令错误 : Failed to parse dotenv file due to an invalid name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55148397/