0

The server (maddogdomains) throws error 503, when the phpspreasheet plugin loads an Excel of 22MB and more than 40,000 records, see line 10 ($reader->load($inputFileName)) of the following code:

$data = array(
    'upload_data' => $this->upload->data()
);
$inputFileType = 'Xls';
$inputFileName =$data['upload_data']['full_path'];

$cache = new FilesystemCache();
\PhpOffice\PhpSpreadsheet\Settings::setCache($cache);
$reader = IOFactory::createReader($inputFileType);
$spreadsheet = $reader->load($inputFileName);

I have increased memory_limit and all the resources in the php.ini and the 503 error persists. How do I solve this error?

1 Answers1

0

It's a question of time spent by PHPSpreadsheet to read the file.

Try to put set_time_limit(0); at top of your script

b126
  • 544
  • 4
  • 11
  • Thanks for the response, I tried that function and error 503 still appears. I think it's a server problem (maddogdomains), because on my local machine that error does not happen – Eduardo Pliego Meré Feb 01 '19 at 21:23