Bug #72747 [Com]: libxml_set_external_entity_loader doesn't work with httpd

From: Date: Mon, 08 Aug 2016 15:06:54 +0000
Subject: Bug #72747 [Com]: libxml_set_external_entity_loader doesn't work with httpd
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203083@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72747&edit=1

 ID:                 72747
 Comment by:         hello at rickwhitehead dot co dot uk
 Reported by:        somewheremylove dot nh87 at gmail dot com
 Summary:            libxml_set_external_entity_loader doesn't work with
                     httpd
 Status:             Closed
 Type:               Bug
 Package:            XML related
 Operating System:   Mac OS X 10.11/10.12
 PHP Version:        7.0.9
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2016-08-08 08:49:34] 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-03 17:37:25] rick at abitdigital dot com

also affects php Version 7.0.6 and 7.0.8 on OSX 10.11.5

------------------------------------------------------------------------
[2016-08-03 16:11:55] 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) 


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=72747&edit=1


Thread (4 messages)

« previous php.bugs (#203083) next »