php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72747 libxml_set_external_entity_loader doesn't work with httpd
Submitted: 2016-08-03 16:11 UTC Modified: 2016-08-08 08:49 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: somewheremylove dot nh87 at gmail dot com Assigned:
Status: Closed Package: XML related
PHP Version: 7.0.9 OS: Mac OS X 10.11/10.12
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: somewheremylove dot nh87 at gmail dot com
New email:
PHP Version: OS:

 

 [2016-08-03 16:11 UTC] somewheremylove dot nh87 at gmail dot com
Description:
------------
libxml_set_external_entity_loader doesn't work with httpd built from source.

Example code from http://php.net/manual/en/function.libxml-set-external-entity-loader.php (Example 1)

Test script:
---------------
http://stackoverflow.com/questions/38683530/libxml-set-external-entity-loader-doesnt-work-in-httpd

Expected result:
----------------
string(10) "-//FOO/BAR"
string(25) "http://example.com/foobar"
array(4) {
  ["directory"]=>
  NULL
  ["intSubName"]=>
  NULL
  ["extSubURI"]=>
  NULL
  ["extSubSystem"]=>
  NULL
}
bool(true)

Actual result:
--------------
Warning: DOMDocument::validate(http://example.com/foobar): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in /www/test.php on line 28

Warning: DOMDocument::validate(): I/O warning : failed to load external entity "http://example.com/foobar" in /www/test.php on line 28

Warning: DOMDocument::validate(): Could not load the external subset "http://example.com/foobar" in /www/test.php on line 28
bool(false) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-03 17:37 UTC] rick at abitdigital dot com
also affects php Version 7.0.6 and 7.0.8 on OSX 10.11.5
 [2016-08-08 08:49 UTC] somewheremylove dot nh87 at gmail dot com
-Status: Open +Status: Closed
 [2016-08-08 08:49 UTC] somewheremylove dot nh87 at gmail dot com
Rebuid httpd with --enable-mpms-shared=all and then add LoadModule mpm_prefork_module modules/mod_mpm_prefork.so into httpd.conf solved this.
 [2016-08-08 15:06 UTC] hello at rickwhitehead dot co dot uk
somewheremylove dot nh87 please could you explain/summarise why mpm_prefork is required in order to fix this libxml http issue? What if we don't wish to run http with mpms? surely this shouldn't prevent libxml from working as intended? Thank you in advance.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC