PHP (Apache) silently converting HTTP 429 and others to 500

前端 未结 2 404
北荒
北荒 2020-12-31 12:18

I just discovered an oddity in PHP\'s header() method silently converting some of my statuses to 500. Since I had no luck in finding mention of this behavior in various web

2条回答
  •  不知归路
    2020-12-31 12:24

    It's perhaps your SAPI configuraiton. Last time I tested something similar, the conclusion looked like this:

    Which in your case works still well for me (Apache 2.2 / FCGI / Windows):

    >curl -i "http://local.example.com/header-test.php"
    HTTP/1.1 429 Too Many Requests
    Date: Thu, 18 Jul 2013 23:49:09 GMT
    Server: Apache/2.2.22 (Win32) mod_fcgid/2.3.6
    X-Powered-By: PHP/5.4.13
    Transfer-Encoding: chunked
    Content-Type: text/html
    
    Too Many Requests
    

提交回复
热议问题