Note that there are some explanatory texts on larger screens.

plurals
  1. POApache resets connection when PHP tells it to 404
    primarykey
    data
    text
    <p>Given the following PHP 5.1.6 code being served through Apache 2.2.9:</p> <pre><code>&lt;?php header("HTTP/1.1 404 Not Found"); </code></pre> <p>When I browse to this file (with any browser) I get a "connection reset" message. (Firefox says "The connection to the server was reset while the page was loading.", and Chrome says "The connection to staging.neopets.com was interrupted." It makes no difference whether there's any body after the header call.</p> <p><code>httpd.conf</code> has rewrite rules that force all requests to run through a front controller script. This is how it's worked for years. The front controller tries to route the request, and if it can't, it sets the response code to 404, shows some error copy, and exits. For whatever reason, today it decided to lose its mind and blow up whenever a</p> <p><code>error.log</code> shows nothing. <code>access.log</code> shows the requests being served as 404s:</p> <pre><code>192.168.0.2 - - [26/Jan/2012:12:03:11 -0800] "GET /text.php HTTP/1.1" 404 20 "-" "Mozilla/5.0 (X11; Linux i686; rv:8.0.1) Gecko/20100101 Firefox/8.0.1" </code></pre> <p>The Apache config has not been touched in months. All other header responses work properly (401, 403, 200, 302, etc.), everything else is totally normal, but for some reason if I have PHP make the call above, it resets the connection.</p> <p>I even watched it with Wireshark and it sends back a whole bunch of <code>RST,ACK</code> packets after the request is sent.</p> <p>Doing <code>wget localhost/test.php</code> (from the machine in question) works fine, but doing <code>wget badhost/test.php</code> (from another machine) shows a connection reset error as well. Maybe Apache is doing some kind of reverse IP lookup on remote requests for 404s and melting down?</p> <p><strong>EDIT:</strong> After further investigation, turns out it's some network problem where 404s between the hosting facility and our office are killed with a connection reset. So, closing because it's not something that anyone here can answer ;-) Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload