我的laravel 5.7项目有问题。我已经在本地开发了它,一切都很好,但是一旦在线发送到我的服务器后,我会遇到此错误:查看[auth.login]。
答案 0 :(得分:1)
遇到同样的问题。我注意到三件事;
启动homestead时出现一条消息,提示虚拟机guest虚拟机工具在主机和guest虚拟机之间不同步。路径可能有问题。我借助此here
在服务器上未找到的 Laravel视图[auth.login] 页面显示了主机的路径,而不显示了vagrant-guest的路径。
bootstrap / cache / config.php 也显示了来自主机而非来宾的路径。
重命名/删除(或import static com.mongodb.client.model.Accumulators.*;
import static com.mongodb.client.model.Aggregates.*;
import static java.util.Arrays.asList;
import static com.mongodb.client.model.Filters.*;
import static com.mongodb.client.model.Projections.*;
import org.bson.conversions.Bson;
MongoCollection<Document> mongoEngCollection = mongoDbReader.getCollection();
List<Bson> obj = new ArrayList<>();
//Forming query using request parameter. requestAttributes contains map of request parameters.
for(Map.Entry<PathAttribute, PathValue<?>> entry : requestAttributes.entrySet()) {
String key = entry.getKey().getName();
//Check if key is not date and set the start and end date
obj.add(eq(key, entry.getValue().getRawValue()));
}
//Build aggregation stages
Bson match = match(and(obj));
Bson group = group(
first("user", "$name"),
sum("total_results", 1),
push("results", "$$ROOT")
);
Bson projection = project(fields(excludeId()));
//Query Mongodb
List<Document> results = mongoEngCollection .aggregate(asList(match, group, projection)).into(new ArrayList<Document>());
)config.php仅给出了错误(Laravel错误“无法加载“ app”配置文件”)。
我通过手动将config.php中的路径更正为流浪汉中的正确路径来解决此问题。
答案 1 :(得分:0)
在服务器上运行以下命令。 它可能会解决您的问题。
php artisan config:clear
php artisan cache:clear
php artisan view:clear
php artisan route:cache
php artisan optimize
或
composer dump-autoload -o
答案 2 :(得分:0)
转到文件夹
bootstrap/cache
将config.php
重命名为config.php_
希望这对您有帮助...
答案 3 :(得分:0)
如果您处于开发模式,则可以运行:
php artisan config:clear
或者如果您处于产品模式,则可以运行:
php artisan config:cache
注意:第二次使用时,请清除配置并再次缓存,然后强制重复执行其他更改的命令。