【问题标题】:Laravel: Error InvalidArgumentExceptionLaravel:错误 InvalidArgumentException
【发布时间】:2016-05-17 15:35:12
【问题描述】:

我将项目从本地主机上传到我的专用服务器,经过这么多问题,终于有些页面可以正常工作 domain.com | domain.com/home | domain.com/allsites 等。

但是现在,路由“domain.com/site/create” “domain.com/site/ID/manage”、“domain.com/site/ID/edit”未找到,我收到此错误,为什么?

FileViewFinder.php 第 137 行中的 InvalidArgumentException:未找到视图 [Site.create]。

在 FileViewFinder.php 第 137 行
FileViewFinder->findInPaths('Site.create',
array('/....../resources/views')) 在 FileViewFinder.php 第 79 行
FileViewFinder->find('Site.create') 在 Factory.php 第 151 行

我尝试了工匠命令:cache:clear、route:clear、config:clear、config:cache 和 nothings 工作,我不知道问题出在哪里!

在本地主机上完美运行

【问题讨论】:

  • 你试过php artisan config:clear | cache

标签: php laravel migration hosting


【解决方案1】:

如果您的本地操作系统与生产服务器操作系统不同,您可能会遇到区分大小写的问题并且找不到文件。确保您的文件名完全相同,大小写。如果一个环境是 Mac 而另一个环境是 Linux,则尤其会发生这种情况。

如果问题没有解决,请通过以下链接。可能对你有帮助

Laravel 5 - View [home] not found

Laravel 5.1 View not found

Laravel 5 InvalidArgumentException in FileViewFinder.php line 137: View [.admin] not found

【讨论】:

  • 天哪!就是它! “站点-> 站点”,我的操作系统-> Windows,服务器操作系统-> Centos。谢谢!谢谢! 5 小时!在我的国家早上 6 点,我安静地睡觉
【解决方案2】:

还多次发现配置缓存存在问题。使用以下命令对其进行微调。

php artisan config:cache
php artisan config:clear

【讨论】:

  • 另外,为引导和存储分配 777 权限对我有用。谢谢
【解决方案3】:

我有同样的问题,但原因不同。对我来说,问题是errors 文件夹的权限。特别是该文件夹不可执行。

在 linux 上解决:

$ chmod +x ../views/errors

【讨论】:

    【解决方案4】:

    尝试以下命令之一:

    php artisan dump-autoloadcomposer dump-autoload

    【讨论】:

      猜你喜欢
      • 2017-03-16
      • 1970-01-01
      • 2018-11-08
      • 1970-01-01
      • 2019-03-17
      • 1970-01-01
      • 2020-01-31
      • 2020-04-08
      • 2015-04-30
      相关资源
      最近更新 更多