遇到致命异常时,如何让php返回500? [英] How can I get php to return 500 upon encountering a fatal exception?
本文介绍了遇到致命异常时,如何让php返回500?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PHP致命错误作为状态代码200返回给HTTP客户端。如何使其返回状态码500(内部服务器错误)?
PHP fatal errors come back as status code 200 to the HTTP client. How can I make it return a status code 500 (Internal server error)?
推荐答案
header("HTTP/1.1 500 Internal Server Error");
这篇关于遇到致命异常时,如何让php返回500?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文