laravel - Laravel ErrorException 没有这样的文件或目录
问题描述
我已经通过 putty 终端在 ubuntu 服务器上上传了我的 Laravel 项目。Composer 安装在服务器机器上,但是当我运行任何工匠命令时,它会出错。
$ php artisan serve
ErrorException
require(/var/www/html/healthapi.fynity.in/routes/api/v1/api.php): failed to open stream: No such file or directory
已经存在,api.php
但我不知道为什么会出现这个错误。尝试了谷歌的所有解决方案。
解决方案
问题:
您之前可能已经更改了某些内容,例如文件的名称或路径。
解决方案:
首先,您使用以下命令清除所有配置。
$ php artisan config:clear
然后,再次运行以下命令。
$ php artisan serve
更新(2021/01/07):
您收到以下错误:
ErrorException require(/var/www/html/healthapi.fynity.in/routes/api/v1/api.php): failed to open stream: No such file or directory at vendor/laravel/framework/src/Illuminate/Routing/RouteFileRegistrar.php:35 31
似乎该库未完全安装。您应该使用以下命令更新库:
$ composer update
然后,再次运行以下命令:
$ php artisan serve
推荐阅读
- linux - 如何在命令行中删除文件夹中的所有目录?
- javascript - 传单:单击时将标记放在前面
- c# - 通过 GroupBy 查找最大值会抛出 Sequence contains no elements 异常
- .htaccess - 从 URL 的请求中删除查询字符串
- scikit-learn - sklearn 模型预测的优化(例如 RandomForestRegressor)
- flutter - 在 Flutter 中根据评分(通过 API 调用获取)对 ListView 进行排序和过滤
- android - Not able to link github private repository to jcenter in bintray
- javascript - 如何计算为数组元素+1
- javascript - 从特定的 Javascript 生成 v4 UUID
- opencv - 使用 OpenCV 绘制连接对象质心的线