[英]How to configure lighttpd display custom 500 error page?
When my php works not correctly, server sends 500 error to browser by default. 当我的PHP无法正常工作时,默认情况下,服务器会向浏览器发送500错误。 I want to see my custom error page. 我想查看我的自定义错误页面。 I tried to use servererror-file prefix, but not work with 500 error. 我尝试使用servererror-file前缀,但无法处理500错误。
In lighttpd 1.4.46 (not yet released), you can choose to intercept errors from dynamic handlers using server.error-intercept = "enable"
. 在lighttpd 1.4.46(尚未发布)中,您可以选择使用server.error-intercept = "enable"
从动态处理程序中拦截错误。 See https://redmine.lighttpd.net/issues/974 参见https://redmine.lighttpd.net/issues/974
However, a better solution is to trap the errors in your PHP script and issue an appropriate error page, rather than crashing. 但是,更好的解决方案是将错误捕获到PHP脚本中并发出适当的错误页面,而不是崩溃。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.