shared-hosting - Laravel 5.8,工匠命令错误 : Failed to parse dotenv file due to an invalid name

标签 shared-hosting laravel-5.8 laravel-artisan phpdotenv

这个问题只发生在我的共享主机上的 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/

相关文章:

laravel-artisan - 不能将 migrate 与sail laravel 一起使用

mysql - MySQL 进程数(平均)为 0.39 很多吗?

ruby-on-rails - 在 Godaddy 共享主机上安装 Ruby

php - 更改 Laravel 4.2 Artisan 命令中的应用程序 url

php - composer global 需要 laravel/installer

laravel - 如何优化 Laravel 超大数据的导入流程?

php - 为什么在 User::first() 上调用方法有效,但 User::where(...) 无效?

php - 共享主机安全吗?

javascript - 我们可以使用 NodeMailer 在 NodeJs 中一次发送多少封电子邮件?

php - Laravel 5.8 : How to send email after user click verify link