2

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

Devsi Odedra
  • 5,244
  • 1
  • 23
  • 37
  • you should extend the timeout or remove the line ini_set("default_socket_timeout", 60) on your php file since the configuration is set already to 300 seconds as mentioned above. – Shudmeyer Jul 27 '16 at 06:05
  • @Shudmeyer Why would the timeout matter? If the script is stopping because of a timeout it won't create `bobby3.html` at all, not create an empty file. – Barmar Jul 27 '16 at 06:20
  • @Barmar, yup it will create an empty file not the contents. we don't exactly what is the query involved on the inspections_print.php (10 records) which make take too long to execute, when it does the contents of bobby3.html will result to empty since timeout is set to 60 seconds – Shudmeyer Jul 27 '16 at 06:28
  • I have found out that the issue is a javascript generated page break that the inspections_print.php is including from another file as it breaks on 2 records and with only 2 records does place some of the js file calls in the bobby3.html. – Bobby Whitley Jul 27 '16 at 14:47

0 Answers0