PHP CLI crashing when processing XLS files but not on XLSX or CSV

Topics: Developer Forum
Jun 23, 2014 at 1:42 PM
Edited Jun 24, 2014 at 10:05 AM
  1. ADDING: Seems the script is making PHP crash, I ran the script thru the CLI and apparently CLI crashes so this points that PHP is failing on something. Is it possible that PHPExcel is doing something naughty when reading XLS?
  2. ADDING 2: Seems its something with the destructor in PHPExcel.php. If I comment out these two functions its no problem anymore. When I try a XLSX file, it runs smoothly, how come its only crashing when I do a XLS? The array is outputed correctly but CLI is giving up after that.
I get connection is reset when running a script that utilize PHPExcel for a XLS file. Same script is running fine with CSV or XLSX.

Windows 7 64bit
Apache 2.2
PHP 5.2.6
PHPExcel 1.7.9

Nothing in PHP logs but Apache says:

[Mon Jun 23 14:37:00 2014] [notice] Parent: child process exited with status 255 -- Restarting.

Weird part is that its only a problem with the XLS files. Any advice?


File 1:

require ("class/ExcelFileReader.php");

$excelFileReader = new ExcelFileReader();
try {
$result = $excelFileReader->getResultArray();
echo var_dump($result);
} catch (Exception $e) {

File 2 function that provides the array:
public function getResultArray() {
    if (file_exists($this->getFileName())) {
        $fileType = PHPExcel_IOFactory::identify($this->getFileName());
        if ($fileType == "CSV") {
            $objReader = PHPExcel_IOFactory::createReader($fileType);
            $objPHPExcel = $objReader->load($this->getFileName());
        } else {
            $objPHPExcel = PHPExcel_IOFactory::load($this->getFileName());

        $sheetArray = array();
        $worksheet = $objPHPExcel->getActiveSheet();
        foreach ($worksheet->getRowIterator() as $row) {
            $cellIterator = $row->getCellIterator();
            $rowArray = array();
            foreach ($cellIterator as $cell) {
                $rowArray[] = $cell->getValue();
            $sheetArray[] = $rowArray;
        //Set result
        $this->_result = $sheetArray;
        return $sheetArray;
    } else {
        throw new Exception("File do not exists!");
If anyone has any suggestions or happends to see this error, give me a shout,

Best regards,

Jun 24, 2014 at 7:26 AM
Edited Jun 24, 2014 at 11:25 AM
Solved by downgrading to 1.7.8.
Marked as answer by gabrielpaulsson on 6/24/2014 at 3:25 AM