Why is a fatal error in PHP returned to a 200 state

Source: Internet
Author: User
Tags http 200 php error
Turn off the error prompt and return to the 500 status.

But whenever the error prompts, he returns 200 regardless of the error. It's bad, it's hard to find the problem

Master, how to display the error message, but also in the wrong time to return 500 status
Rather than 200 states


Reply to discussion (solution)

HTTP 500 is a server rejection response. There is no explanation for the cause of the error, so it's unfriendly.
When PHP error display is turned on, the error message can be sent with the text, so it is HTTP 200
The error message is mixed in the body, although it is unsightly, but indicative is clear

500 is the response of the server, after the error prompt is the PHP prompt error, but the server processing PHP script is successful, so it is 200 status

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.