I am trying to install Magento 2.0.2 on a GoDaddy "Ultimate Linux Hosting with cPanel" server. When I open the page I am given this error:

Fatal error: Class 'DOMDocument' not found in /home/intx/public_html/dev/vendor/magento/framework/Config/Dom.php on line 364

I have tried looking all over and can not figure out what I am supposed to do to fix this.


6 Answers 6


Install these 2 extention and restart apache

 sudo apt-get install php7.1-dom
 sudo apt-get install php7.1-xml
 sudo service apache2 restart

Note: php version according to your current php version


I know this is a pretty old question, but just in case someone came here (as I did)...

You have to install the php-dom module on your system, on debianlike systems:

apt-get install php-xml

And restart your server:

service apache2 restart

I have the same issue:

Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/vendor/magento/framework/Config/Dom.php:377

But i installed php7.0-xml package which is running


Hi I think that you have used php7.1 version, You can check that by using

php -v

You should change default php version to php 7.0 use command line

sudo update-alternatives --config php

then select correct version (php7.0)


for centos 7 (linux)

yum install php-xml

for ubuntu

apt-get install php-xml

use sudo if you are not a root user for privileges


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.

Your Answer

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

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