wordpress - PHP server file download cutoff unexpectedly -


i have web interface built admin section of wordpress site. scrapes few tables in database , displays big list of data row row. there 30,000 rows of data, displayed basic echo in loop. displaying 30,000 rows on page works fine.

additionally, include option download csv file of complete rows of data. use fopen , fputcsv build csv file download result of data query. feature used work, dataset @ 30,000, csv no longer generate correctly. happens first 200~1000 rows written csv file leaving out majority of data. estimate csv not generated in case 10 megs. file download first 200~1000 rows though working correctly.

here code:

// gets huge list of data sp built. data formed $data = $this->run_stats_stored_procedure($job_to_report);  // data converted csv file. part broken // file may exist @ location burn down if if(file_exists(abspath . "some/path/to/my/file/csv_export.csv")) {     unlink(abspath . "some/path/to/my/file/csv_export.csv");                  } $csv_file_handler = fopen(abspath . "some/path/to/my/file/candidate_export.csv", 'w');  if(!empty($csv_file_handler)) {      $title_array = array(         "id",         "other_feild"     );      fputcsv($csv_file_handler, $title_array, ",");      if(!empty($data)) {          foreach($data $data_piece) {             $array_as_csv_line = array();                 foreach($data_piece $object_property) {                                   $array_as_csv_line[] = (string)$object_property;             }              fputcsv($csv_file_handler, $array_as_csv_line, ",");                 unset($array_as_csv_line);         }     } else {         fputcsv($csv_file_handler, array("empty"), ",");     }                // pros clean when done     fclose($csv_file_handler); } 

i'm not sure need change entire csv file download. believe configuration issue, i'm not should. led believe because function used work 20,000 csv rows, @ 30,000 , breaking. please let me know if additional info help. has bumped issues huge csv files before? thank can help.

is "download" taking more minute, 2 minutes, or 3 minutes? if so, webserver closing connection. example, if you're using apache fcgi module, has directive:

fcgidbusytimeout 

which defaults 300 seconds.

this maximum time limit request handling. if fastcgi request not complete within fcgidbusytimeout seconds, subject termination.

hope helps solve problem.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -