抱歉,找不到您要查找的页面且不显示任何错误:Laravel 5.5
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45992984/
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
Sorry, the page you are looking for could not be found without showing any error : Laravel 5.5
提问by Sujeesh S
Newly installed Laravel 5.5 showing Sorry, the page you are looking for could not be found. without any error . Please see the screenshot :
新安装的 Laravel 5.5 显示 抱歉,找不到您要查找的页面。没有任何错误。请看截图:
I think its not even looks into routes file, this is my routes.php and htaccess
我认为它甚至没有查看路由文件,这是我的 routes.php 和 htaccess
What will be the reason for this ?
这是什么原因?
回答by Arthur Samarcos
All your WEB routes will be located in the file:
您所有的 WEB 路由都将位于文件中:
routes\web.php
Register your routes there.
在那里注册您的路线。
回答by chebaby
Order
命令
Pay attention to routes order, it's really important (fooled me so many times to be honest).
注意路由顺序,这真的很重要(老实说骗了我很多次)。
Because Laravel goes through list of routes top to bottom until it finds the first match, as a rule of thumb, try to define routes with no parametres first then routes with parameters in your route file (web/api).
因为 Laravel 从上到下遍历路由列表,直到找到第一个匹配项,所以根据经验,尝试首先定义没有参数的路由,然后在路由文件 (web/api) 中使用参数进行路由。
Example: (based on Radical's answer)
Route::get('/blog/{id}', 'BlogController@show');
Route::get('/blog/comments', 'BlogController@comments');
In this case, Route::get('/blog/{id}', 'BlogController@show');
comes first so it would be selected. Even when what you really want is Route::get('/blog/comments', 'BlogController@comments');
在这种情况下,Route::get('/blog/{id}', 'BlogController@show');
首先出现所以它会被选中。即使你真正想要的是Route::get('/blog/comments', 'BlogController@comments');
My two cents :)
我的两分钱 :)
回答by Zezi Reeds
I ran into this issue when findOrFail
method failed in the Controller method.
当findOrFail
Controller 方法中的方法失败时,我遇到了这个问题。
回答by Precious Nanle Luke
There are a lot of reasons why this won't work
这行不通的原因有很多
Probably the route was written well eg:
Route::get('/boost/{type}/{{type_id}}', ['uses' => 'RequestController@getBoosted', 'as'=>'boosts/{{type}}/{{type_id}}']);
when it is meant to be like this:Route::get('/boost/{type}/{type_id}', ['uses' => 'RequestController@getBoosted', 'as'=>'boosts/{type}/{type_id}']);
Looking at the two above code the second route is correct because of the curly brackets are one instead of twoProbably you will be needing to clear your cache which happens at rare occasions
Probably the developer in question did not put the links properly at there controllers
Return view('site.block')
you must make sure that the page that is referenced is at the correct location
可能路线写得很好,例如:
Route::get('/boost/{type}/{{type_id}}', ['uses' => 'RequestController@getBoosted', 'as'=>'boosts/{{type}}/{{type_id}}']);
当它是这样的:Route::get('/boost/{type}/{type_id}', ['uses' => 'RequestController@getBoosted', 'as'=>'boosts/{type}/{type_id}']);
查看上面的两个代码,第二条路线是正确的,因为大括号是一个而不是两个您可能需要清除缓存,这在极少数情况下发生
可能有问题的开发人员没有将链接正确放置在控制器上,
Return view('site.block')
您必须确保引用的页面位于正确的位置
回答by Keval Mangukiya
I think you can use this commands:
我认为您可以使用以下命令:
php artisan config:cache
php artisan view:clear
php artisan config:cache
php artisan view:clear
these commands use and I hope your error solve
这些命令使用,我希望你的错误解决
回答by gaborkorodi
Ensure that your register.blade.php
is in the resources/views
directory and remove the trailing slash from the URL you are assigning to this view.
确保您register.blade.php
在resources/views
目录中并从您分配给此视图的 URL 中删除尾部斜杠。
Sometimes the error messages in the storage/logs/laravel.log
log file (if you have the default configuration) can help as well.
有时storage/logs/laravel.log
日志文件中的错误消息(如果您有默认配置)也有帮助。