PHPExcel not loading .xlsx in PHP earlier than 5.2.11

I worked on an legacy system running PHP 5.2.6 on Windows and I can’t update it.

With php_zip enabled, PHPExcel loads .xls but still not .xlsx.
When loading a .xlsx, it’s simply die without any error message.

I have enabled all error report, but still no any clue.

After some brute-force debugging, I found the root cause:

The two lines of

in Settings.php caused PHP fatal error and halted the output.
Worse still, those statements are suppressed by @ operator

libxml_disable_entity_loader is only available >= PHP 5.2.11

Comment it seems didn’t hurt anything. Problem solved!

Well, perfect example of why @ operator evil.

I have filed an issue to developers on GitHub, because PHPExcel claim to support down to 5.2.0.

3 Replies to “PHPExcel not loading .xlsx in PHP earlier than 5.2.11”

Leave a Reply

Your email address will not be published.