简体   繁体   中英

Fatal error: Allowed memory size of 134217728 bytes exhausted in C:\wamp\www\zannier\Classes\PHPExcel\CachedObjectStorage\CacheBase.php

i try to treat a massive excel file (5500 row * 50 column) with PHP my code is correct i don't have any bug when i tried it for only 100 rows. but when i put the whole file, i have this fatal Error i tried to change the memory_limit to 256 instead of 128 but nothing happen is there any solution to process my hole file !

the error is : Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in C:\\wamp\\www\\zannier\\Classes\\PHPExcel\\CachedObjectStorage\\CacheBase.php on line 173 and my code is :

 <?php

    require_once ".\Classes\PHPExcel\IOFactory.php";

    $objPHPExcel = PHPExcel_IOFactory::load("zfg01_CAT.xls");


    $sheet = $objPHPExcel->getSheet(0);

   include 'fonctionsUtiles.php';
  // afficherUneFeuille($sheet);
   echo'<br>';
   echo $sheet->getHighestRow();
   echo'<br>';

   supprimerLesDoublons($sheet);
   afficherUneFeuille($sheet);
    echo $sheet->getHighestRow();
   echo'<br>';

    ?>

Thanks !

您需要重新启动Apache才能获取更改的设置

Do it with caution: set memory_limit = -1 in php.ini file. Restart Apache.

Important for WAMP : it uses two php.ini file, the one when you click throught WAMP tray menu (works for apache when you open the script in the browser) and the other one inside WAMP's directory tree (something like C:\\wamp64\\bin\\php\\php5.6.25\\php.ini) who works when you execute PHP in the command line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM