Apache/PHP returns HTTP Status Code 200 on error pages

前端 未结 3 1098
囚心锁ツ
囚心锁ツ 2021-02-14 21:33

I\'m running PHP 5.4 on CentOS 7 and when there is a php file that throws an error (either an exception, or a syntax error) it returns an HTTP 200 status code instead of 500.

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-14 22:18

    Note that this may sometimes be down to the CustomLog format in apache. For example %>s ("the final status") can (correctly) yield a 403 in the access log whereas just %s may record a 200 even when the status code of the response was something else.

提交回复
热议问题