Im trying to implement Converting single sheet in an XLS file to CSV with PHPExcel - Memory exhausted but im still running into memory problems.
Think @BT643 code - which I used - includes most of the golden rules explained by @Mark Baker in various posts compiled in his answer (phpexcel Allowed memory size of 134217728 bytes exhausted).
My excel file has 61 columns and about 8000 lines, so some half a million cells. Size 5561KB. I would not expect it require reading "chunks".
What am I missing?
Here's the code I'm using:
include 'Classes/PHPExcel.php';
include 'Classes/PHPExcel/IOFactory.php';
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp;
$cacheSettings = array( 'memoryCacheSize' => '2GB');
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
$reader = PHPExcel_IOFactory::createReader('Excel5');
$reader->setReadDataOnly(true);
$reader->setLoadSheetsOnly('mytab');
$filename = 'C:/xampp/htdocs/mycode/myfile.xls';
$excel = $reader->load($filename);
$filename_fixed='myfile.csv';
$writer = PHPExcel_IOFactory::createWriter($excel, 'CSV');
$writer->save($filename_fixed);