Skip to content
This repository

Warning: dom_import_simplexml() in XmlFileLoader.php #3643

Closed
j opened this Issue March 19, 2012 · 3 comments

2 participants

Jordan Stout Scott Brown
Jordan Stout
j commented March 19, 2012

I get the following error

ErrorException: Warning: dom_import_simplexml(): Invalid Nodetype to import in /myproject/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php line 424

Steps to produce the error:

git clone http://github.com/symfony/symfony-standard.git && cd symfony-standard && php composer.phar install && sudo chmod -R 777 app/cache

Upon doing that, I can browse to app_dev.php/ and see the Welcome screen.

I immediately do, rm -rf app/cache/* then go back to the browser and get the above error.

The rest of my stack-trace:

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

Hopefully this is a super simple solution.

Extra Info:

********************************
*                              *
*  Symfony requirements check  *
*                              *
********************************

php.ini used by PHP: /etc/php.ini

** WARNING **
*  The PHP CLI can use a different php.ini file
*  than the one used with your web server.
*  If this is the case, please ALSO launch this
*  utility from your web server.
** WARNING **

** Mandatory requirements **

  OK        Checking that PHP version is at least 5.3.2 (5.4.0 installed)
  OK        Checking that vendor libraries are installed
  OK        Checking that the "date.timezone" setting is set
  OK        Checking that app/cache/ directory is writable
  OK        Checking that the app/logs/ directory is writable
  OK        Checking that the json_encode() is available
  OK        Checking that the session_start() is available
  OK        Checking that the ctype_alpha() is available
  OK        Checking that the token_get_all() is available
  OK        Checking that the simplexml_import_dom() is available
  OK        Checking that the APC version is at least 3.0.17
  OK        Checking that php.ini has detect_unicode set to off
  OK        Checking that php.ini has suhosin.executor.include.whitelist correctly configured

** Optional checks **

  OK        Checking that the PHP-XML module is installed
  OK        Checking that the mb_strlen() function is available
  OK        Checking that the iconv() function is available
  OK        Checking that the utf8_decode() is available
  OK        Checking that the posix_isatty() is available
  OK        Checking that the intl extension is available
  OK        Checking that the intl ICU version is at least 4+
  OK        Checking that a PHP accelerator is installed
  OK        Checking that php.ini has short_open_tag set to off
  OK        Checking that php.ini has magic_quotes_gpc set to off
  OK        Checking that php.ini has register_globals set to off
  OK        Checking that php.ini has session.auto_start set to off

** Optional checks (Doctrine) **

  OK        Checking that PDO is installed
  OK        Checking that PDO has some drivers installed: mysql, sqlite

Notice that we're using PHP 5.4

Jordan Stout
j commented March 19, 2012

seems to be an issue with my php5.4 installation. closing this issue.

Jordan Stout j closed this March 19, 2012
Scott Brown

Can you detail what your problem was and how you fixed it? I am getting the same error message with php 5.4. Can't seem to find what the problem is though

Jordan Stout
j commented March 31, 2012

I believe it was an outdated version of libxml. I initially installed php5.3 via yum and ended up compiling it myself with all the proper configuration and updated files

http://www.php.net/manual/en/simplexml.requirements.php

http://www.php.net/manual/en/simplexml.installation.php

http://www.php.net/manual/en/libxml.installation.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.