<tfoot id='s418s'></tfoot>
    1. <i id='s418s'><tr id='s418s'><dt id='s418s'><q id='s418s'><span id='s418s'><b id='s418s'><form id='s418s'><ins id='s418s'></ins><ul id='s418s'></ul><sub id='s418s'></sub></form><legend id='s418s'></legend><bdo id='s418s'><pre id='s418s'><center id='s418s'></center></pre></bdo></b><th id='s418s'></th></span></q></dt></tr></i><div id='s418s'><tfoot id='s418s'></tfoot><dl id='s418s'><fieldset id='s418s'></fieldset></dl></div>
      • <bdo id='s418s'></bdo><ul id='s418s'></ul>

      <legend id='s418s'><style id='s418s'><dir id='s418s'><q id='s418s'></q></dir></style></legend>

      <small id='s418s'></small><noframes id='s418s'>

        Laravel 4 异常:NotFoundHttpException

        Laravel 4 Exception: NotFoundHttpException(Laravel 4 异常:NotFoundHttpException)
      1. <legend id='WsvtU'><style id='WsvtU'><dir id='WsvtU'><q id='WsvtU'></q></dir></style></legend>

          1. <tfoot id='WsvtU'></tfoot>

            <i id='WsvtU'><tr id='WsvtU'><dt id='WsvtU'><q id='WsvtU'><span id='WsvtU'><b id='WsvtU'><form id='WsvtU'><ins id='WsvtU'></ins><ul id='WsvtU'></ul><sub id='WsvtU'></sub></form><legend id='WsvtU'></legend><bdo id='WsvtU'><pre id='WsvtU'><center id='WsvtU'></center></pre></bdo></b><th id='WsvtU'></th></span></q></dt></tr></i><div id='WsvtU'><tfoot id='WsvtU'></tfoot><dl id='WsvtU'><fieldset id='WsvtU'></fieldset></dl></div>

            <small id='WsvtU'></small><noframes id='WsvtU'>

              <tbody id='WsvtU'></tbody>
                <bdo id='WsvtU'></bdo><ul id='WsvtU'></ul>
                  本文介绍了Laravel 4 异常:NotFoundHttpException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的 Laravel 4 应用程序的日志有时会显示 NotFoundHttpException:

                  My Laravel 4 application's logs sometimes show a NotFoundHttpException:

                  exception 'SymfonyComponentHttpKernelExceptionNotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420
                  Stack trace:
                  #0 /var/www/laravel4/bootstrap/compiled.php(7137): IlluminateRoutingRouter->handleRoutingException(Object(SymfonyComponentRoutingExceptionResourceNotFoundException))
                  #1 /var/www/laravel4/bootstrap/compiled.php(7113): IlluminateRoutingRouter->findRoute(Object(IlluminateHttpRequest))
                  #2 /var/www/laravel4/bootstrap/compiled.php(958): IlluminateRoutingRouter->dispatch(Object(IlluminateHttpRequest))
                  #3 /var/www/laravel4/bootstrap/compiled.php(946): IlluminateFoundationApplication->dispatch(Object(IlluminateHttpRequest))
                  #4 /var/www/laravel4/public/index.php(49): IlluminateFoundationApplication->run()
                  #5 {main}
                  

                  是什么原因造成的?堆栈跟踪没有显示我的代码中的任何内容.

                  What could have caused this? The stack trace doesn't show anything from my code.

                  推荐答案

                  NotFoundHttpException 基本上只是应用程序中的 404.不幸的是,异常消息甚至没有告诉您触发异常的请求的 URL,这使得当您在日志中看到这些错误时很难理解它们.

                  A NotFoundHttpException is basically just a 404 in your application. Unfortunately the exception message doesn't even tell you the URL of the request that triggered the exception, which makes it difficult to understand these errors when you see them in your logs.

                  要为您提供更多调试信息,请设置您自己的 404 处理程序.这是一个简单的处理程序,它将记录 URL(因此您知道触发错误的请求)和用户代理(帮助您确定是谁或什么发出了请求)并返回一个视图和 404 代码:

                  To give you more debugging information, set up your own 404 handler. Here's a simple handler which will log the URL (so you know what was requested to trigger the error) and the user agent (to help you figure out who or what made the request) and return a view and 404 code:

                  App::missing(function($e) {
                      $url = Request::fullUrl();
                      $userAgent = Request::header('user-agent');
                      Log::warning("404 for URL: $url requested by user agent: $userAgent");
                      return Response::view('errors.not-found', array(), 404);
                  });
                  

                  把它放在app/start/global.php中.

                  这篇关于Laravel 4 异常:NotFoundHttpException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <bdo id='opMHa'></bdo><ul id='opMHa'></ul>
                  • <small id='opMHa'></small><noframes id='opMHa'>

                      <tbody id='opMHa'></tbody>
                  • <tfoot id='opMHa'></tfoot>
                    <legend id='opMHa'><style id='opMHa'><dir id='opMHa'><q id='opMHa'></q></dir></style></legend>

                    <i id='opMHa'><tr id='opMHa'><dt id='opMHa'><q id='opMHa'><span id='opMHa'><b id='opMHa'><form id='opMHa'><ins id='opMHa'></ins><ul id='opMHa'></ul><sub id='opMHa'></sub></form><legend id='opMHa'></legend><bdo id='opMHa'><pre id='opMHa'><center id='opMHa'></center></pre></bdo></b><th id='opMHa'></th></span></q></dt></tr></i><div id='opMHa'><tfoot id='opMHa'></tfoot><dl id='opMHa'><fieldset id='opMHa'></fieldset></dl></div>