laravel

laravel

lumen Symfony\Component\HttpKernel\Exception\NotFoundHttpException

php25ma.cn 发表了文章 • 0 个评论 • 416 次浏览 • 2020-03-09 14:16 • 来自相关话题

记一次 lumen开发中遇到的坑[code]前景:

[2020-03-09 14:02:04] local.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException in /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:233
Stack trace:
#0 /mnt/hgfs/netmarble/GalaxyMxS 查看全部
记一次 lumen开发中遇到的坑
前景:

[2020-03-09 14:02:04] local.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException in /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:233
Stack trace:
#0 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(170): Laravel\Lumen\Application->handleDispatcherResponse(Array)
#1 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(420): Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Laravel\Lumen\Http\Request))
#2 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(172): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#3 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(109): Laravel\Lumen\Application->dispatch(NULL)
#4 /mnt/hgfs/netmarble/GalaxyMxSDK/api/public/index.php(28): Laravel\Lumen\Application->run()
#5 {main} {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): at /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:233)
[stacktrace]
#0 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(170): Laravel\\Lumen\\Application->handleDispatcherResponse(Array)
#1 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(420): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))
#2 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(172): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))
#3 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(109): Laravel\\Lumen\\Application->dispatch(NULL)
#4 /mnt/hgfs/netmarble/GalaxyMxSDK/api/public/index.php(28): Laravel\\Lumen\\Application->run()
#5 {main}
"}

 
通过堆栈信息了解到,该错误是从 
vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(170): Laravel\Lumen\Application->handleDispatcherResponse(Array)

触发,随后就打印这个方法下的170行,查看是什么路由触发的这个错误

微信图片_20200309141126.png

 
看到日志中的结果是:


微信截图_20200309141340.png


 
然后 第一反映这个不是浏览器请求的时候,默认的一次获取icon的请求么。
接着去查看一下 public 目录下有没有这个文件
 
或者还有其他解决方式可以留言,谢谢
 

微信图片_20200309141912.png


直接从其他项目复制了这个 favicon.ico 到根目录,结果问题得到解决
 

lumen Symfony\Component\HttpKernel\Exception\NotFoundHttpException

php25ma.cn 发表了文章 • 0 个评论 • 416 次浏览 • 2020-03-09 14:16 • 来自相关话题

记一次 lumen开发中遇到的坑[code]前景:

[2020-03-09 14:02:04] local.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException in /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:233
Stack trace:
#0 /mnt/hgfs/netmarble/GalaxyMxS 查看全部
记一次 lumen开发中遇到的坑
前景:

[2020-03-09 14:02:04] local.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException in /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:233
Stack trace:
#0 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(170): Laravel\Lumen\Application->handleDispatcherResponse(Array)
#1 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(420): Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Laravel\Lumen\Http\Request))
#2 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(172): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#3 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(109): Laravel\Lumen\Application->dispatch(NULL)
#4 /mnt/hgfs/netmarble/GalaxyMxSDK/api/public/index.php(28): Laravel\Lumen\Application->run()
#5 {main} {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): at /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:233)
[stacktrace]
#0 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(170): Laravel\\Lumen\\Application->handleDispatcherResponse(Array)
#1 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(420): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))
#2 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(172): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))
#3 /mnt/hgfs/netmarble/GalaxyMxSDK/api/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(109): Laravel\\Lumen\\Application->dispatch(NULL)
#4 /mnt/hgfs/netmarble/GalaxyMxSDK/api/public/index.php(28): Laravel\\Lumen\\Application->run()
#5 {main}
"}

 
通过堆栈信息了解到,该错误是从 
vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(170): Laravel\Lumen\Application->handleDispatcherResponse(Array)

触发,随后就打印这个方法下的170行,查看是什么路由触发的这个错误

微信图片_20200309141126.png

 
看到日志中的结果是:


微信截图_20200309141340.png


 
然后 第一反映这个不是浏览器请求的时候,默认的一次获取icon的请求么。
接着去查看一下 public 目录下有没有这个文件
 
或者还有其他解决方式可以留言,谢谢
 

微信图片_20200309141912.png


直接从其他项目复制了这个 favicon.ico 到根目录,结果问题得到解决