Notice: Undefined property: DOMDocument::$documentElement in /var/www/html/projectnenny/vendor/magento/framework/Config/Dom.php on line 148

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Config\Dom::_mergeNode() must be an instance of DOMElement, null given, called in /var/www/html/projectnenny/vendor/magento/framework/Config/Dom.php on line 148 and defined in /var/www/html/projectnenny/vendor/magento/framework/Config/Dom.php:164 Stack trace: #0 /var/www/html/projectnenny/vendor/magento/framework/Config/Dom.php(148): Magento\Framework\Config\Dom->_mergeNode(NULL, '') #1 /var/www/html/projectnenny/vendor/magento/framework/Config/Reader/Filesystem.php(151): Magento\Framework\Config\Dom->merge('_readFiles(Object(Magento\Framework\Config\FileIterator)) 3 /var/www/html/projectnenny/generated/code/Magento/Framework/ObjectManager/Config/Reader/Dom/Proxy.php(95): Magento\Framework\Config\Reader\Filesystem->read('global') #4 /var/www/html/projectnenny/vendor/magento/framework/Interception/C in /var/www/html/projectnenny/vendor/magento/framework/Config/Dom.php on line 164

Normally I use PHP 7.2 for Magento 2. Recently I received a complete project in Magento that is not running in PHP 7.2, so I change my PHP version to 7.0 also. Install all required extensions in PHP 7.0 version

and when open my project Home page receiving this error. after that also run all issue related commands like:-

sudo apt-get install php7.0-dom 


sudo apt-get install php7.0-xml

but my problem is not solved.

Please help

  • What is the magento version of your new project
    – surbhi agr
    Jul 22, 2019 at 10:33

1 Answer 1


In my case the dom extension was enabled twice. Once in the dom.ini and also in the php.ini. I removed the extension=dom.so entry from the php.ini and reloaded the apache2 webserver.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.