1

I'm using PHP OCI8 to retrieve data from oracle database into MS Excel Spreadsheet by using PHP Excel Function. The data consist of 23 column and more then 65k row. I consider this as big data and its fail to write to Excel and showing this error

Fatal error: Maximum execution time of 900 seconds exceeded in C:\inetpub\wwwroot\Classes\PHPExcel\Writer\Excel2007\Worksheet.php on line 1058

  1. My question is how to calculate the right amount of time needed with the data that Im extracting?

  2. What is the best practice of extracting this large data into Spreadsheet or CSV file?

in the code is already set oci_set_prefetch($stid1, 400); and if data less then 65k the system will allow to write to the file (.xls)

  • See if this can help you: http://stackoverflow.com/a/24481241/460557 teaches how to increase the Maximum execution – Jorge Campos Oct 12 '15 at 03:54
  • Best advice is to run large data extracts as a background process, not from the Web SAPI..... your code may also be inefficient, but we can't comment on that as we can't see it – Mark Baker Oct 12 '15 at 06:55
  • But if you can use a CSV file, then use that instead with PHP's fputcsv() function.... if the data equates to a single worksheet, and you don't need any of the formatting or other features of MS Excel, then it's a lot more efficient – Mark Baker Oct 12 '15 at 06:56
  • Mark Baker - I'm planning to request user to download the data by themself, some of them doesn't know how to view the CSV data in Excel. Is there any possibility I can write again the CSV file format onto Excel Spreadsheet. – Mohd Shahzuan Azmi Oct 12 '15 at 09:12
  • MS Excel will happily import a csv file, either via its import menu option, or by double-clicking on the csv file to open it – Mark Baker Oct 12 '15 at 09:49
  • If you still want to export an Excel file, you can take a look at this question: http://stackoverflow.com/a/32890264/4499987 – Adrien Oct 12 '15 at 17:37

0 Answers0