title: Understanding “408 Request Timeout” on Apache with PHP
body: <p><strong>Issue description - Apache logs</strong></p>
  
  
  
  <p>I found items similar to this one in the Apache log file:</p>
  
  <pre class="lang-none prettyprint-override"><code>166.147.68.243 [24/Feb/2013:06:06:25 -0500] 19 web-site.com "-" 408 - "-"
  </code></pre>
  
  <p>I’ve got custom log format and <code>408</code> here stands for status. The log format is:</p>
  
  <pre class="lang-none prettyprint-override"><code>LogFormat "%h %t %D %V \"%r\" %&gt;s %b \"%{User-agent}i\"" detailed
  </code></pre>
  
  <p>And normally the line in the log file looks like</p>
  
  <pre class="lang-none prettyprint-override"><code>184.73.232.108 [26/Feb/2013:08:38:16 -0500] 30677 www.site.com "GET /api/search... HTTP/1.1" 200 205 "Zend_Http_Client"
  </code></pre>
  
  <p>This is why 408 error lines look strange to me. No request is logged and I have no idea on what should be optimized.</p>
  
  <p><strong>Questions</strong></p>
  
  <p>How to tackle the issue?
  What additional information or logs should I gather?
  What might cause the issue? Is this something wrong on the server? Or is this absolutely a network connectivity problem?</p>
  
  <p>I’m addressing this because our customer complained that he has got 408 error on his mobile phone. I found many records in the log file but I have to admit I don’t know what to do with this.</p>
  
  <hr>
  
  <p><strong>My own research</strong></p>
  
  <p>There are several questions on this subject already here. But people are much more specific. Like they discus issues with some specific client software and scripts. Here I just got the error when opening some page on iPhone.</p>
  
  <p>For example in <a href="https://stackoverflow.com/questions/1667720/http-408-request-timeout">HTTP, 408 Request timeout</a>, it is suggested to do the GET request before POST. If I have custom client I can do this. But I can not control the behavior of the user’s browser.</p>
  
  <p><strong>Guess #1</strong></p>
  
  <p>When searching the Internet and thinking about the issue I found <a href="https://serverfault.com/questions/383290/too-many-408-error-codes-in-access-log">https://serverfault.com/questions/383290/too-many-408-error-codes-in-access-log</a></p>
  
  <p>The suggestion is to update the <a href="http://httpd.apache.org/docs/2.2/mod/core.html#timeout" rel="noreferrer"><code>Timeout</code></a> config parameter back to its default value.</p>
  
  <pre class="lang-none prettyprint-override"><code>#
  # Timeout: The number of seconds before receives and sends time out.
  #
  Timeout 300
  </code></pre>
  
  <p>I tried the value 30 first because I thought 30 seconds should be enough. <strong>But even with 300 seconds default value, I continue to get the errors in the log.</strong> I did <code>tail -f</code> when I was writing this text and got more then 10 lines in a few minutes.</p>
  
  <p>To me this does not look a complete solution.</p>