php出现致命异常为何返回的还是200状态

WBOY
Release: 2016-06-13 12:08:45
Original
1011 people have browsed it

php出现致命错误为何返回的还是200状态
关了错误提示就返回500状态。

但只要开了错误提示,无论什么错误他都返回200。这样很不好,难以发现问题

求高手,如何既可以显示错误信息,又可以在错误的时候返回500状态
而不是200状态
------解决思路----------------------
http 500 是服务器拒绝响应。没有说明出现错误的原因,所以很不友好
开启了 php 错误显示后,错误信息可随正文一起发出,所以是 http 200
错误信息夹杂在正文中,虽然有碍观瞻,但指示性还是很明确的
------解决思路----------------------
500 是服务器的响应,开启错误提示后就是php提示错误,但服务器处理php脚本是成功的,所以是200状态

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!