title: Prevent nginx 504 Gateway timeout using PHP set_time_limit()
body: <p>I am getting 504 timeouts message from nginx when my PHP script is running longer than usual. <code>set_time_limit(0)</code> does not seem to prevent that! Does it not work when running php5-fpm on nginx? If so, whats the proper way of setting the time limit?</p>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>504 Gateway Time-out
  nginx/1.2.7
  </code></pre>