PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.2k forks source link

simplexml_load_file not working after PHPExcel_IOFactory::load call #1361

Closed LaySoft closed 6 years ago

LaySoft commented 6 years ago

I've spent some hours, to find what's the error:

<?php
error_reporting(E_ALL); ini_set('display_errors', TRUE);
require_once '../API/PHPExcel/Classes/PHPExcel/IOFactory.php';
$xls = PHPExcel_IOFactory::load('lufi.xls');
$hiba = '';
set_error_handler(function($errno, $errstr, $errfile, $errline) use (&$hiba) {
    $hiba .= $errstr . PHP_EOL;
});
if (simplexml_load_file('test.xml', NULL, LIBXML_NOCDATA)) {
    echo 'xml OK' . PHP_EOL;
} else {
    echo $hiba;
    echo 'xml ERROR' . PHP_EOL;
}

This gives simplexml_load_file(): I/O warning : failed to load external entity "test.xml" error. If i comment out the $xls = PHPExcel_IOFactory::load('lufi.xls'); line, everything good, xml opened. How can I solve this?

PowerKiKi commented 6 years ago

Duplicate of https://github.com/PHPOffice/PhpSpreadsheet/issues/74, migrate to PhpSpreadsheet to solve it.