title: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 373 bytes) in [mypath] on line 65
body: <p>Im trying to implement <a href="https://stackoverflow.com/questions/15530302/converting-single-sheet-in-an-xls-file-to-csv-with-phpexcel-memory-exhausted">Converting single sheet in an XLS file to CSV with PHPExcel - Memory exhausted</a> but im still running into memory problems.</p>
  
  <p>Think @BT643 code - which I used - includes most of the golden rules explained by @Mark Baker in various posts compiled in his answer (<a href="https://stackoverflow.com/questions/5560053/phpexcel-allowed-memory-size-of-134217728-bytes-exhausted">phpexcel Allowed memory size of 134217728 bytes exhausted</a>).</p>
  
  <p>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".</p>
  
  <p>What am I missing?</p>
  
  <p>Here's the code I'm using:</p>
  
  <pre><code>include 'Classes/PHPExcel.php';
  include 'Classes/PHPExcel/IOFactory.php';
  
  $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp;
  $cacheSettings = array( 'memoryCacheSize' =&gt; '2GB');
  PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
  
  $reader = PHPExcel_IOFactory::createReader('Excel5');
  $reader-&gt;setReadDataOnly(true);
  $reader-&gt;setLoadSheetsOnly('mytab');
  
  $filename = 'C:/xampp/htdocs/mycode/myfile.xls';
  
  $excel = $reader-&gt;load($filename);
  
  $filename_fixed='myfile.csv';
  $writer = PHPExcel_IOFactory::createWriter($excel, 'CSV');
  $writer-&gt;save($filename_fixed);
  </code></pre>