6.0.0-beta1
7/17/25

[#13025] Cannot load conf.xml in horde config
Summary Cannot load conf.xml in horde config
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester spamstop2 (at) terriertech (dot) com
Created 03/09/2014 (4148 days ago)
Due
Updated 03/24/2014 (4133 days ago)
Assigned
Resolved 03/24/2014 (4133 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
03/24/2014 11:36:13 AM Jan Schneider Comment #7
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Horde_Core 2.12.0
03/24/2014 11:35:43 AM Jan Schneider Version ⇒ Git master
Queue ⇒ Horde Framework Packages
 
03/24/2014 11:34:34 AM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (master):

commit 34647e69d81cc6c0a77060dbcaaf4b05caca7397
Author: Jan Schneider <jan@horde.org>
Date:   Mon Mar 24 12:32:43 2014 +0100

     [jan] Fix loading of configuration screen with basedir 
restrictions or libxml entity loading disabled (Bug #13025).

  framework/Core/lib/Horde/Config.php |    2 +-
  framework/Core/package.xml          |    2 ++
  2 files changed, 3 insertions(+), 1 deletions(-)


03/24/2014 08:13:00 AM lehmann (at) ans-netz (dot) de Comment #5 Reply to this comment
I'm seing the exact same error when trying to access Kronolits 
Configuration page:

Mar 24 09:06:50 avocado HORDE: [horde] PHP ERROR: DOMDocument::load(): 
I/O warning : failed to load external entity 
&quot;/usr/local/www/horde/kronolith/config/conf.xml&quot; [pid 5960 
on line 187 of "/usr/local/share/pear/Horde/Config.php"]

The proposed patch from the previous comment fixed this issue on my side!
03/12/2014 04:30:05 PM spamstop2 (at) terriertech (dot) com Comment #4
New Attachment: config2.patch Download
Reply to this comment
We don't use external entities in the Horde configuration, and we 
definitely don't load horde/config/conf.xml as an external entity. 
Since this doesn't even happen deterministically, this has to be 
some problem with your system/server.
I think a revisit is needed for this.  Try putting 
libxml_disable_entity_loader(true) before the $dom->load().

When this is done it fails 100%, tried with both apache/mod_php and 
nginx/php-fpm.  If it doesn't for you, then my system is broken.

This shows that entity loading needs to be enabled in libxml2, even 
though the file is local and doesn't include <!ENTITY.

Normally this is OK because libxml2 enables entity loading by default. 
  But this is going to fail in two situations:

1. For anyone using PHP-FPM, due to libxml_disable_entity_loader not 
being thread safe, see https://bugs.php.net/bug.php?id=64938.

2. Starting in libxml2 2.9, it will be off by default, see 
http://framework.zend.com/security/advisory/ZF2014-01.

Even if you don't want to fully enable entity loading, this can be 
simply fixed using the attached patch.
03/11/2014 02:22:32 AM spamstop2 (at) terriertech (dot) com Comment #3 Reply to this comment
We don't use external entities in the Horde configuration, and we 
definitely don't load horde/config/conf.xml as an external entity. 
Since this doesn't even happen deterministically, this has to be 
some problem with your system/server.
Thanks Jan.  It seems this is related to setting open_basedir 
separately for Horde, and some type of interaction between php-fpm 
pools.  Removing open_basedir restrictions (at least temporarily) has 
fixed it.
03/10/2014 11:47:20 AM Jan Schneider Comment #2
State ⇒ Not A Bug
Reply to this comment
We don't use external entities in the Horde configuration, and we 
definitely don't load horde/config/conf.xml as an external entity. 
Since this doesn't even happen deterministically, this has to be some 
problem with your system/server.
03/09/2014 01:12:58 PM spamstop2 (at) terriertech (dot) com Comment #1
State ⇒ Unconfirmed
New Attachment: config.patch Download
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ Cannot load conf.xml in horde config
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
Symptom: Horde configuration editor, 
http://localhost/admin/config/config.php?app=<anything>, gives white 
screen until web server restarted.

Reproducing: This cannot be reproduced with 100% reliability, but I 
can cause it with very high probability with the following steps.
1. Restart web server
2. Go to Horde config
3. Go to Imp
4. Go to Kronolith
5. Return to Horde config
6. Reload page about 5 times

Relevant logs: syslog,

Mar  9 07:47:54 host HORDE: [horde] PHP ERROR: DOMDocument::load(): 
I/O warning : failed to load external entity 
"/usr/share/pear/www/horde/config/conf.xml" [pid 17425 on line 187 of 
"/usr/share/pear/Horde/Config.php"]

error.log,

2014/03/09 07:57:35 [error] 18034#0: *18 FastCGI sent in stderr: "PHP 
message: PHP Fatal error:  Call to a member function hasChildNodes() 
on a non-object in /usr/share/pear/Horde/Config.php on line 204
PHP message: PHP Stack trace:
PHP message: PHP   1. {main}() 
/usr/share/pear/www/horde/admin/config/config.php:0
PHP message: PHP   2. Horde_Config_Form->__construct() 
/usr/share/pear/www/horde/admin/config/config.php:35
PHP message: PHP   3. Horde_Config->readXMLConfig() 
/usr/share/pear/Horde/Config/Form.php:67" while reading response 
header from upstream, client: 127.0.0.1, server: localhost, request: 
"GET /admin/config/config.php?app=horde HTTP/1.1", upstream: 
"fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost", referrer: 
"http://localhost/admin/config/"

Cause: Appears to be the same root problem and solution described at 
http://pyd.io/f/topic/failed-to-load-external-entity-boot-confmanifest-xml/page/3/#post-72211

Solution: Add call to libxml_disable_entity_loader(false) before 
loading conf.xml in /usr/share/pear/Horde/Config.php (see patch).

Environment: Horde 5.1.5, php 5.3.3, libxml2 2.7.6.

Saved Queries