PHP:500错误错误页面

编程入门 行业动态 更新时间:2024-10-24 14:23:08
本文介绍了PHP:500错误错误页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

作为prelude,我知道什么是HTTP 500是的,我知道如何解决这些问题。

As a prelude, I know what a HTTP 500 is, and I know how to fix them.

在PHP 5.3,我正在一个生产环境show_errors关闭。当有任何致命错误,用户得到一个纯白色的500页面响应。我想以防万一有创建一个500错误页面的任何任何错误;只是这样更人性化。

On PHP 5.3, i'm running a production environment with show_errors off. When there are any fatal errors, the user gets a plain white 500 page in response. I'm trying to create a 500 error page just in case there any any errors; just so it is more user friendly.

我曾经是能够做到

ErrorDocument 500 500.html

这似乎没有然而,要工作了, - 甚至以为我404

It doesn't seem to be working anymore, however - even thought my 404

ErrorDocument 404 404.html

工作正常。

好奇,想看看解决这方面 - 感谢您的时间。

Curious to see solutions regarding this - Thank you for your time.

推荐答案

致命错误并不在自身生产500错误,他们将返回200空白页通常是(如果没有输出已刷新到浏览器在点错误的)。加上这不会帮助你,无论如何,像Apache将不再参与时,PHP是有错误。

Fatal errors don't produce 500 errors in and of themselves, they would return 200 with blank page typically (if no output had been flushed to browser at the point of the error) . Plus this will not help you anyway, as Apache would be no longer involved when PHP is having the error.

也许你可以注册一个关断功能来发送500头(获得500结果),并显示你要显示的内容。

Maybe you could register a shutdown function to send 500 header (to get 500 result) and display the content you want to display.

更多推荐

PHP:500错误错误页面

本文发布于:2023-10-31 15:38:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546527.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   页面   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!