0

How to read large data from Excel files (14MB+) in PHPExcel? I have done with excelreader it says Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36 bytes) in E:\xampp\htdocs\Projects\PIN\library\excel_reader2.php on line 1508

can any one give me the link to read the excel large data?

user3251820
  • 9
  • 1
  • 5
  • possible duplicate of [phpexcel Allowed memory size of 134217728 bytes exhausted](http://stackoverflow.com/questions/5560053/phpexcel-allowed-memory-size-of-134217728-bytes-exhausted) – Sander Dec 02 '14 at 10:31
  • http://stackoverflow.com/questions/561066/php-fatal-error-allowed-memory-size-of-134217728-bytes-exhausted-codeigniter – Parthi04 Dec 02 '14 at 10:31
  • Are you really using PHPExcel? `excel_reader2.php` is not a part of the PHPExcel library. – Mark Baker Dec 02 '14 at 10:37
  • If you are using PHPExcel, then are you using cell caching? If so, what method? Or have you considered using "chunking" to read the file in smaller bite-sized chunks rather than all in one go? – Mark Baker Dec 02 '14 at 10:39
  • if you don't mind?can you say me what is chucking? is it phpexcel file or what? – user3251820 Dec 02 '14 at 10:42
  • I have previously had the same problem of processing a large Excel file using PHP. Not only did I have this problem, but you will also have a problem of the shear amount of time that it will take (although this depends on what you are actually doing with the Excel document). My advice would be to try and process Excel documents some alternative way that is not PHP. – Antony D'Andrea Dec 02 '14 at 10:47
  • [PHPExcel](https://github.com/PHPOffice/PHPExcel/) is a library for reading/writing Excel files - you mention it in your question, yet the error message that you show suggests that you're not actually using PHPExcel at all, but some other library.... PHPExcel provides a number of methods for reducing memory requirements when working with large spreadsheets, such as "cell caching" and "read chunking". These are described in the PHPExcel documentation – Mark Baker Dec 02 '14 at 10:48
  • I have increase memory size to 1512 now the data is going to database.total excel file value is 150000 data each and every time it store only 500 value in database? why it store 500? what is the maximum database size – user3251820 Dec 02 '14 at 11:29

1 Answers1

0

Increase the memory php can use.

Edit php.ini and change the memory_limit option, for example:

memory_limit = 128M ; /* Change the 128M to your needs */

Also, read this related post: ini_set("memory_limit") in PHP 5.3.3 is not working at all

Community
  • 1
  • 1
AntonioHS
  • 1,360
  • 10
  • 25