当前位置:   article > 正文

php过滤excel文件,phpexcel读取excel内存释放怎么处理

php调用excel文件后,如何释放et.exe

php使用phpexcel读取excel的时候,如果excel本身行列较多,很容易引起

Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes)

内存不够的报错,

于是我写了一段脚本,利用phpexcel过滤器实现块级读取,但是每次读取完毕了,占用的内存不会释放掉,造成多次读取以后还是会报出Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes)内存不够的错误?

使用unset,=null都没有明显的作用,后面查了下资料,

在PHPExcel_Worksheet和phpexcel类中加了Desroty方法,并且显式调用也没有用

public function Destroy() {

foreach($this->_cellCollection as $index => $dummy) {

$this->_cellCollection[$index] = null;

}

$this->_cellCollection = null;

}

public function Destroy() {

foreach($this->_workSheetCollection as $index => $dummy) {

$this->_workSheetCollection[$index]->Destroy();

$this->_workSheetCollection[$index] = null;

}

$this->_workSheetCollection = null;

}

请问哪位大佬有解决方案啊?

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/49658?site
推荐阅读
相关标签
  

闽ICP备14008679号