php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #68325 LIBXML_PARSEHUGE cannot be set for xml_parser_create
Submitted: 2014-10-29 17:13 UTC Modified: 2018-04-02 00:12 UTC
Votes:27
Avg. Score:4.5 ± 0.8
Reproduced:24 of 24 (100.0%)
Same Version:4 (16.7%)
Same OS:6 (25.0%)
From: pdx at pdx dot hu Assigned:
Status: Open Package: XML related
PHP Version: 5.4.34 OS: CentOS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pdx at pdx dot hu
New email:
PHP Version: OS:

 

 [2014-10-29 17:13 UTC] pdx at pdx dot hu
Description:
------------
---
From manual page: http://www.php.net/function.xml-parser-set-option
---

Short story: since LibXML>2.7.6 larger xml chunks must be explicitly allowed by setting LIBXML_PARSEHUGE for libxml. There is no option to do that with xml_parser_set_option. And believe me, xml_parser indeed chokes on most of what I throw at it.

Please see this discussion at http://stackoverflow.com/questions/25042325/sax-parser-php-no-memory-at-line-x .

The version is actually 5.4.33 (the latest available 5.4 branch on Remi's CentOS packages), but from the documentation it's clear that it hasn't been dealt with yet.

Also, bug#65604 https://bugs.php.net/bug.php?id=65604&edit=2 deals with the same source of problem, but there has been no fix as of yet.

Test script:
---------------
not necessary.

Expected result:
----------------
correct XML parsing as before.

Actual result:
--------------
XML error: No memory at line XX (various).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-02 00:12 UTC] cmb@php.net
FWIW: it is possible to parse large XML documents in chunks; a
respective example has been added to the manual[1].  With this
technique, processing psd7003.xml[2] worked without problems.

[1] <http://svn.php.net/viewvc?view=revision&revision=344608>
[2] <http://aiweb.cs.washington.edu/research/projects/xmltk/xmldata/www/repository.html#pir>
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Feb 29 01:01:29 2020 UTC