Here is my code
<?php
ini_set("default_socket_timeout", 60);
include("include/dbcommon.php");
ob_start();
include("inspections_print.php");
$page_content = ob_get_contents();
ob_end_clean();
file_put_contents('files/bobby3.html',$page_content);
?>
The inspections_print.php request records from a mysql database and builds a report. It works and creates the bobby3.html file if it only request 1 record, if I request 10 records it creates an empty bobby3.html file. This on a Linode server that I have complete control over. It is set to use 1024M
of memory max_execution_time
= 300 and default_socket_timeout
= 300