Magento2: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found

Created on 8 Apr 2017  路  9Comments  路  Source: magento/magento2

user@user:/opt/lampp/htdocs/magento2$ php bin/magento setup:upgrade

PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php:364
Stack trace:

0 /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php(109): Magento\FrameworkConfig\Dom->_initDom('

1 /opt/lampp/htdocs/magento2/vendor/magento/framework/ObjectManager/Config/Reader/Dom.php(70): Magento\FrameworkConfig\Dom->__construct('

2 /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Reader/Filesystem.php(146): Magento\Framework\ObjectManagerConfig\Reader\Dom->_createConfigMerger('Magento\Framewo...', '

3 /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\FrameworkConfig\Reader\Filesystem->_readFiles(Object(Magento\FrameworkConfig\FileIterator))

4 /opt/lampp/htdocs/magento2/vendor/magento/framework/App/ObjectManagerFactory.php(269): Magento\FrameworkConfig in /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php on line 364

Format is not valid

Most helpful comment

How's teaching people how to use Google sarcastic? I'm teaching one of the most valuable techniques out there. :clinking_glasses:

You know why you considered it sarcastic? Because searching in Google beforehand has become obvious for you. But it's not for many people. Let's make it obvious for all. 馃寪

All 9 comments

I already tried those steps but nothing changed in error. I trying to make a simple module in magento 2

It is not clear which exact steps you have tried, but the issue you have doesn't seem to be caused by the Magento itself, rather by the absence of the php-xml module which you could've probably try to identify and fix yourself first rather than report it as a Magento's bug hoping someone fixes it for you (which is probably more or less whet @adragus-inviqa meant by that sarcastic link). php-xml is clearly stated as "required" by the DevDocs.

If you are unable to resolve that requirement yourself, or if you are looking for some additional help or an advice regarding setup or development please refer to the Community Forums or the Magento Stack Exchange.
The GitHub issue tracker is intended for tracking technical issues (read: "bugs") only.
The issues which cannot be consistently reproduced on a clean installation of Magento 2 CE installed on a sufficient server environment aren't likely to get resolved in here.

How's teaching people how to use Google sarcastic? I'm teaching one of the most valuable techniques out there. :clinking_glasses:

You know why you considered it sarcastic? Because searching in Google beforehand has become obvious for you. But it's not for many people. Let's make it obvious for all. 馃寪

Thank you sir, for your warm reply that solved my problem.

I am facing same issue with the theme installation, could you please help me out it to resolve.

@RohitGour next time you encounter some common issue, please considering reading the whole thread prior to posting. The answer or the solution or a workaround might be right in front of your eyes already.

In this particular case, please attempt installing\enabling the php-xml extension.

http://bfy.tw/B7uZ

u are an id!ot

Solved: I realized that the php commands I was executing were run by the php installed on the system, and not the one in use by Xampp. Thus installing the php-xml part solved that issue. I resolved all the subsequent errors in the same way. So far, the app is running ok. Granted, a proper, clean stack would be preferable, but this will do for now.

Was this page helpful?
0 / 5 - 0 ratings