Mysql xlsx file import with php script Large file in MBs -
I have tried importing .xlsx file into php using PHP-EXCEL class. I have been successful in doing this but when the Excel file increases and size goes into MBs and hundreds of thousands of records in the record, it generates cell caching problems. Has anyone got the solution for this?
Allocate more memory to process large files.
To do this, you can do either in php:
ini_set ('memory_limit', '64M'); // 64 MB is an example (which should be your case anyway), if you currently have 64, then set it to 128.
Or search directly from your php.ini file, following line:
memory_limit = 64M;
Then, 64M is an example, but this should be your case;)
If you still have problems with the memory limit, then please Re-increase to 256MB or 512 MB (which should be enough for the 10 MB XLSX file, if I'm not mistaken).
Besides, remembering to set up infinite also from time to time, Excel files usually take a lot of time to expand.
Again, you can easily do that either from your php script or in your php.ini file. Here I propose to do this directly to my PHP script, because you may have other scripts which do not require much time:
ini_set ('max_execution_time', 0) ; // 0 = & gt; No Limit
Comments
Post a Comment