Laravel错误“无法加载"app"配置文件" Windows文件还原后 [英] Laravel Error "Unable to load the "app" configuration file" after Windows file restore

查看:437
本文介绍了Laravel错误“无法加载"app"配置文件" Windows文件还原后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天早上犯了严重错误.我卸载了WAMP Server,该服务器删除了Wamp文件夹及其所有项目.

Bad mistake this morning. I uninstalled WAMP Server which deleted the Wamp folder and all its projects.

我从备份还原了wamp文件夹. WAMP已像以前一样在升级的PHP和设置上启动并运行,

I restored the wamp folder from backup. WAMP is up and running on upgraded PHP and settings as before, however:

Laravel项目将无法启动-在任何Laravel项目上出现空白的空白页.当我进入任何项目文件夹并尝试运行php artisan时,我得到:

Laravel projects won't start - getting blank whoops pages on any Laravel project. When I cd into any project folder and try to run php artisan, I get:

Unable to load the "app" configuration file.

'config/app.php'确实存在.而且,所有还原的文件都显示正确.

The 'config/app.php' does indeed exist. And, all the restored files appear correct.

作为测试,我安装了一个新的Laravel项目,它可以正常运行.我还能够从Git存储库npm update&中克隆项目. composer install,并且有效.因此,我认为问题不在于WAMP堆栈.

As a test, I installed a new Laravel project and it works correctly. I also am able to clone a project from a Git repo, npm update & composer install, and that works. So, I don't think the problem is with the WAMP stack.

我需要一些指导来对此进行故障排除.谢谢!

I need some direction troubleshooting this. Thanks!

推荐答案

问题是

The problem is that Windows changes the case of some file names during restore. What a drag. There seems to be no reasonable answer except make the switch to Apple.

例如,在Laravel配置文件夹中,Windows使用适当的大小写App.php, Auth.php, Queue.php, and View.php还原了这些文件.其他所有东西都按需保留为小写.

For example, in the Laravel config folder, Windows restored these files with proper case, App.php, Auth.php, Queue.php, and View.php. Everything else was left lowercase as they need to be.

更正这些文件的大小写,目前已解决了该问题(直到我找到其他大小写错误的文件).

Correcting the case of these files fixed the problem for now (until I find other mis-cased files).

这篇关于Laravel错误“无法加载"app"配置文件" Windows文件还原后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆