title: Apache return 200 when memory is full
body: <p>Found below by checking the error log:</p>
  <blockquote>
  <p>PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes)</p>
  </blockquote>
  <p>so then i have tried it to reproduce on my local setup. So what i did is changed the <code>memory_limit</code> to 10 MB and tried to call one of API manually. In that case server return 500 which is correct (i.e. display above error with 500 HTTP Status).</p>
  <p>But now if i set it to 1MB then it returns 200 HTTP status (without processing any thing, i have simple message on first line.). So what is the reason behind it and how to solve it?</p>
  <p><strong>In short if server returns 500 for 10 MB limit then it should also return 500 for 1MB correct?</strong></p>
  <p><strong>Is it possible that some how apache return default HTTP Status if it can't process the request? If yes how can we know the default HTTP status and how one can change that?</strong></p>
  <p>PHP Version: 7.0.33<br />
  Apache Version: 2.4.39</p>
  <h2>With Memory limit 1 MB</h2>
  <p><a href="https://i.stack.imgur.com/bf8Fa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bf8Fa.png" alt="enter image description here" /></a></p>
  <h2>With 10 MB limit</h2>
  <p><a href="https://i.stack.imgur.com/lTx5N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lTx5N.png" alt="enter image description here" /></a></p>
  <h2>update</h2>
  <p>I didn't posted the code because i thought it was irrelevant because above issue occur when there is too much traffic on server and it happen for any api which i have. We have one voucher selling feature and when it start we receive too many request and during that time period we face above memory error other time we don't face it. So my thought was because there might be no memory to process the request and hence server return default 200. To achieve that i have set memory limit too low in my local setup.</p>
  <p>So question is how force the server to return 500 if there is no memory to process the request.</p>