title: TCPDF - Internal Server Error (500) on live server with large files only
body: <p>I am having an issue with TCPDF when attempting to render a large file: a 66 page HTML table, however the problem only happens after pushing the script to the live server.</p>
  
  <p>My <code>localhost</code> renders the file to completion, albeit quite slowly, but the live server returns the 500 Internal Server Error eventually.  </p>
  
  <p>There is nothing wrong with the actual script, as far as I can tell, as reducing the size of the HTML table down to 500 rows returns the PDF in a matter of seconds.  My <code>localhost</code> takes over a minute to return the same 500 lines, and 4 minutes to return the full table, so I would have thought that the live server would make short work of it but it just cannot handle it.</p>
  
  <p>Likewise, the bulk content for the PDF is generated by a script that takes over 30 seconds to render on my <code>localhost</code>, whereas the live server makes short work of it and can return the results in less than a second, so the performance of the live server is proven to be superior (as you'd expect, of course). </p>
  
  <p>I've already set, to no avail: </p>
  
  <pre><code>ini_set("memory_limit", "-1");
  ini_set('max_execution_time', 0);
  set_time_limit(0);
  </code></pre>
  
  <p>The server is shared hosting, but I do have quite a lot of control over it and the hosting providers are willing to make reasonable changes if I can't do them myself.  However, I need to pinpoint the cause before I can ask them to make any changes.</p>
  
  <p>It's not ideal, but even if the file takes a long time to complete I'm happy to implement a work-around so that the file is rendered in the background and then emails the user upon completion with a download link.  However, as the rendering aborts I can't even do this.</p>
  
  <p>Any help is greatly appreciated!</p>
  
  <p><strong><em>EDIT:</em></strong></p>
  
  <p>I forgot to mention until reminded in the comments: I get nothing in the error logs.  If I remove something critical from the script, such as the DB connector, then that logs as expected, but nothing related to TCPDF is getting logged.</p>
  
  <p><strong><em>Additional Info:</em></strong></p>
  
  <p>I was using Dompdf originally, but this was unable to render more than 100 lines of the same table without failing.  This was both locally and on the live server, which is a shame because it handled CSS and HTML very well and required far fewer work-arounds for content positioning.</p>