[PHP 5.4][2.1] Warning: dom_import_simplexml(): Invalid Nodetype to import in XmlFileLoader #4185

sebastianblum opened this Issue May 2, 2012 · 11 comments


None yet
6 participants


Fedora 16 has now PHP 5.4 and I upgraded my servers. I am using Symfony 2.1
Now I get the following error:

Web Output:
1/1ErrorException: Warning: dom_import_simplexml(): Invalid Nodetype to import in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 424
in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php line 65
at ErrorHandler->handle('2', 'dom_import_simplexml(): Invalid Nodetype to import', '/var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php', '424', array('xml' => object(SimpleXMLElement)))
at dom_import_simplexml(object(SimpleXMLElement)) in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 424
at XmlFileLoader->loadFromExtensions(object(SimpleXMLElement)) in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 56
at XmlFileLoader->load('web.xml') in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php line 42
at FrameworkExtension->load(array(array('translator' => array('fallback' => 'de'), 'secret' => '_censored_', 'charset' => 'UTF-8', 'router' => array('resource' => '/var/www/projectname-test/app/config/routing.yml'), 'form' => true, 'csrf_protection' => true, 'validation' => array('enable_annotations' => true), 'templating' => array('engines' => array('twig')), 'default_locale' => 'de', 'session' => null), array('router' => array('resource' => '/var/www/projectname-test/app/config/routing_dev.yml'), 'profiler' => array('only_exceptions' => false))), object(ContainerBuilder)) in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php line 42
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 119
at Compiler->compile(object(ContainerBuilder)) in /var/www/projectname-test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 449
at ContainerBuilder->compile() in /var/www/projectname-test/app/bootstrap.php.cache line 888
at Kernel->buildContainer() in /var/www/projectname-test/app/bootstrap.php.cache line 797
at Kernel->initializeContainer() in /var/www/projectname-test/app/bootstrap.php.cache line 519
at Kernel->boot() in /var/www/projectname-test/app/bootstrap.php.cache line 562
at Kernel->handle(object(Request)) in /var/www/projectname-test/web/app_stage.php line 23

Console Output:
Warning: dom_import_simplexml(): Invalid Nodetype to import in /var/lib/jenkins/jobs/projectname-test/workspace/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 424

SimpleXML was trying to load this file:

I can't find a solution for that, but in #3643 (already closed) looks ilke the same issue, but is closed.

Thank you very much for helping me.

greetings from munich, sebastian


stof commented May 2, 2012

what is your libxml version ? It is available in the phpinfo


libXML support active
libXML Compiled Version 2.7.8
libXML Loaded Version 20708
libXML streams enabled

Simplexml support enabled
Revision $Id: 455280fc74f9f002b7314def7a456f6c3080eb92 $
Schema support enabled

XML Support active
XML Namespace Support active
libxml2 Version 2.7.8

additional PHP Informations:
PHP Version 5.4.1
APC 3.1.10
Curl 7.21.7

System: Fedora 16 - all components are installed with yum and updated to the latest version.

This also occurs with Symfony 2.0 and PHP 5.4.2 (Fedora 16, compiling PHP locally)

This appears to be a general php 5.4.x issue, possibly associated with the build/distribution.

Using example 1 from http://www.php.net/manual/en/function.dom-import-simplexml.php I get the same error if executing using the php-cgi command from a prompt, but not if using the php command.

pierres commented May 5, 2012

Disable APC.

pierres commented May 5, 2012

I have filed an upstream bug report: https://bugs.php.net/bug.php?id=61956 (please vote if you confirm the issue on other systems as well)

Thank you very much for creating the php bug issue. I didn't believe that it could be a php bug.


mrohnstock commented May 10, 2012

confirm, disabling apc fixed the issue on archlinux, too.

pierres commented Jun 11, 2012

This has now been fixed upstream. (and for the record it is fixed in Arch Linux apc 3.1.10-3)

Thank you very much


mvrhov commented Jul 20, 2012

And those who were waiting for an official release APC 3.1.11 was released yesterday with included fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment