如何在 laravel 4 上显示错误? [英] How to display errors on laravel 4?

查看:20
本文介绍了如何在 laravel 4 上显示错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Laravel 4 beta 上创建一个应用程序,但我无法调试它,因为它没有显示任何错误,display_errors 已打开,error_reportingE_ALLdebug =>真(config/app.php).当我尝试在 public/index.php 上执行错误时,它会显示解析错误,但是当我在路由器上执行此操作时,它只会显示一个空白页面(白屏死机).我该如何解决这个问题?

I'm trying to create an app on Laravel 4 beta but I can't debug it because it doesn't show any error, display_errors is on, error_reporting is E_ALL and debug => true (config/app.php). When I try to do an error on public/index.php it shows a parse error, but when I do it on the router it just shows a blank page (White screen of death). How can I fix this?

谢谢

推荐答案

@Matanya - 您是否查看了服务器日志以了解错误 500 究竟是什么?可以是任意数量的东西

@Matanya - have you looked at your server logs to see WHAT the error 500 actually is? It could be any number of things

@Aladin - Laravel 4 可以通过三种方式诊断白屏死机 (WSOD).

@Aladin - white screen of death (WSOD) can be diagnosed in three ways with Laravel 4.

选项 1: 转到您的 Laravel 日志 (app/storage/logs) 并查看错误是否包含在其中.

Option 1: Go to your Laravel logs (app/storage/logs) and see if the error is contained in there.

选项 2:转到 PHP 服务器日志,并查找导致 WSOD 的 PHP 错误

Option 2: Go to you PHP server logs, and look for the PHP error that is causing the WSOD

选项 3: 良好的旧式调试技巧 - 在路由文件的开头添加 die('hello') 命令 - 然后不断将其移入应用程序中,直到您不再看到你好"的消息.使用它,您将能够缩小导致 WSOD 的范围并解决问题.

Option 3: Good old debugging skills - add a die('hello') command at the start of your routes file - then keep moving it deeper and deeper into your application until you no longer see the 'hello' message. Using this you will be able to narrow down the line that is causing your WSOD and fix the problem.

这篇关于如何在 laravel 4 上显示错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆