title: PHP set_time_limit no effect
body: <p>I have a very painful slow script that gets lots of data from MySQL and creates a large report out of it that it serves to the user at the end as application/force-download. </p>
  
  <p>Long story short, on production server it keeps terminating after about 30 seconds (quite consistently) and spitting out an empty file instead. On development server it works fine, but it does take significantly longer to execute - about 90 seconds. Just to be 'safe', I set my php.ini file to <code>max_execution_time = 2000</code> and also run <code>set_time_limit(4000)</code> in the beginning of my script (numbers way over the expected completion time, but just to be sure ;)). </p>
  
  <p>What could be causing my web server to ignore the time limits I set and quit on me after only 30 seconds?</p>
  
  <p>Edit: one thing I know for sure is that it takes MySQL portion of the code 8-9 seconds to complete, and it successfully gets past that point every time.</p>