使Chrome浏览器显示页面甚至可以在500或404代码上运行(表现得像Firefox一样) [英] Make Chrome display pages even on 500 or 404 codes (behave like Firefox)

查看:2283
本文介绍了使Chrome浏览器显示页面甚至可以在500或404代码上运行(表现得像Firefox一样)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在Symfony开发一个新的站点。当Symfony遇到一个错误,如找不到路由,调试设置为true时,它不仅输出404代码,实际上在页面上显示错误。 Firefox显示服务器返回的内容,但Chrome不支持。



对于我找不到路由的例子:

Firefox显示这个: http://i.imgur.com/myF85Sl.png

Chrome显示: http://i.imgur.com/hex19In.png

有没有一种方法可以让Chrome在这种情况下表现得像Firefox一样?

编辑:要对实际发生的事情提出质疑。我不知道是什么原因造成的,否则我会修复它。以下是我在Chrome网络检查器中看到的内容(请注意,此图像是500错误,但404也是如此): http://i.imgur.com/VIOWGRy.png



注意零的内容长度。如果我通过Firefox(相同的服务器,一切)去完全相同的URL,它显示实际的Symfony错误。

你的config_dev.yml中的monolog配置,删除firephp / chromephp部分。


We're developing a new site in Symfony. When Symfony encounters an error, such as a "no route found", and debug is set to true, it not only outputs a 404 code, it actually shows the error on the page. Firefox displays what the server returned, but Chrome does not.

For my no route found example:

Firefox shows this: http://i.imgur.com/myF85Sl.png
Chrome shows this: http://i.imgur.com/hex19In.png

Is there a way to get Chrome to behave like Firefox under these conditions?

Edit: There seems to be some questioning of what's actually happening. I don't know what's causing this, otherwise I would fix it. Here's what I see in the Chrome network inspector (note that this image is for a 500 error, but the same happens with 404's): http://i.imgur.com/VIOWGRy.png

Notice the content length of zero. If I go to the exact same URL through Firefox (same server, everything), it shows the actual Symfony error.

解决方案

Under the monolog config in your config_dev.yml, remove the firephp/chromephp sections.

这篇关于使Chrome浏览器显示页面甚至可以在500或404代码上运行(表现得像Firefox一样)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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