php Laravel:错误 InvalidArgumentException

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35261746/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:24:40  来源:igfitidea点击:

Laravel: Error InvalidArgumentException

phplaravelmigrationhosting

提问by Vincen

I' upload the project from localhost to my dedicated server and after so many problems, finally some pages works domain.com | domain.com/home | domain.com/allsites etc..

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

But now, the routes "domain.com/site/create" "domain.com/site/ID/manage", "domain.com/site/ID/edit" not found, i get this error, why?

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

InvalidArgumentException in FileViewFinder.php line 137: View [Site.create] not found.

in FileViewFinder.php line 137 at
FileViewFinder->findInPaths('Site.create',
array('/....../resources/views')) in FileViewFinder.php line 79 at
FileViewFinder->find('Site.create') in Factory.php line 151

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

在FileViewFinder.php线137
FileViewFinder-> findInPaths( 'Site.create',
在FileViewFinder.php线79在阵列( '/....../资源/视图'))
FileViewFinder->找到(“网站。在 Factory.php 第 151 行中创建')

I try artisan comands: cache:clear, route:clear, config:clear, config:cache and nothings works, i don't know where is the problem!

我尝试了工匠命令:缓存:清除,路线:清除,配置:清除,配置:缓存和什么都没有,我不知道问题出在哪里!

On localhost it works perfectly

在本地主机上它完美地工作

回答by iSensical

also multiple times its found that config cache being problem. Use following commands to finetune them.

也多次发现配置缓存有问题。使用以下命令对它们进行微调。

php artisan config:cache
php artisan config:clear

回答by Haz Pro

If your local OS is different from your production server OS you might be running into a case-sensitive issue and the file is not being found. make sure your files names are EXACTLY the same, case and all. This can happen especially if one environment is Mac and the other is Linux.

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

If the issue is not fixed, please go through the following link. It may help you

如果问题未解决,请访问以下链接。它可能会帮助你

Laravel 5 - View [home] not found

Laravel 5 - 查看 [主页] 未找到

Laravel 5.1 View not found

未找到 Laravel 5.1 视图

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

FileViewFinder.php 第 137 行中的 Laravel 5 InvalidArgumentException:未找到视图 [.admin]

回答by Mugoma J. Okomba

I had same issue but cause was different. For me the problem was permissions on errorsfolder. In particular the folder was not executable.

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

To resolve on linux:

在linux上解决:

$ chmod +x ../views/errors

回答by Wagner Messias Cavalcanti

Try one of these commands:

尝试以下命令之一:

php artisan dump-autoloador composer dump-autoload

php artisan dump-autoload或者 composer dump-autoload