Home > Backend Development > PHP Tutorial > php批量导入数据出错解决方案

php批量导入数据出错解决方案

WBOY
Release: 2016-06-13 09:58:54
Original
996 people have browsed it

php批量导入数据出错
我现在要做的是,把一个产品数据从EXCEL中导入到PHP的MYSQL中,导入的过程中,总是会提示“Allowed memory size of 167772160 bytes exhausted (tried to allocate 689919 bytes) in D:\wamp\www\Company\product\admin\uploadOrder.php on line 167”这个错误,然后我分成第100条导入时,就不会提示这个错误,这个是不是内存溢出,有没有好的解决方法呢?

------解决方案--------------------
php.ini中讲memory_limit选项设置大一点,然后重启apache或nginx就行了
------解决方案--------------------
文件太大了,这样的话可以用source命令直接导入!
------解决方案--------------------

探讨

我用ini_set('memory_limit','-1');就不会提示错误,请问这样会不会影响到其它

------解决方案--------------------
不过都是设置成0,至于负数没试过
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template