I'm getting the below error while access the website.

Fatal error: Uncaught Error: Class 'DOMDocument' not found in /home/rugsahos/public_html/vendor/magento/framework/Config/Dom.php:384 Stack trace: #0 /home/rugsahos/public_html/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('__construct('_createConfigMerger('Magento\Framewo...', '_readFiles(Object(Magento\Framework\Config\FileIterator)) #4 /home/rugsahos/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(275): Magento\Framework\Config in /home/rugsahos/public_html/vendor/magento/framework/Config/Dom.php on line 384

Can you please let me know the proper solution for this error?

  • Its depends on your last action. Could you please check var/log or var/report folder on Magento root to get more details ? Nov 22 '19 at 6:41
sudo apt-get install php7.1-dom
sudo apt-get install php7.1-xml
sudo service apache2 restart

Note: You can set php version according to your instance.

  • while enter the above command in terminal this error is showing sudo: /bin/sudo must be owned by uid 0 and have the setuid bit set Nov 22 '19 at 7:14
  • I guess you are using linux system, if so it seems like you do not have super user permission to access this on SSH. Kindly contact your system administrator. Nov 22 '19 at 7:16
  • yes we are using linux server Nov 22 '19 at 7:24
  • So you'll maybe have only permission to run magento 2 commands only. Kindly contact your system administrator person to install these libraries. Nov 22 '19 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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