Skip to content
Advertisement

Magento: Class ‘DOMDocument’ not found

I’m installing Magento on Amazons AWS Lightsail system. I’ve installed NGINX, MySQL & PHP

But I keep getting this error:

2018/11/11 11:31:14 [error] 24035#0: *1 FastCGI sent in stderr: "PHP     message: PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /var/www/html/vendor/magento/framework/Config/Dom.php:384
Stack trace:
#0 /var/www/html/vendor/magento/framework/Config/Dom.php(115): MagentoFrameworkConfigDom->_initDom('<?xml version="...')
#1 /var/www/html/vendor/magento/framework/ObjectManager/Config/Reader/Dom.php(70): MagentoFrameworkConfigDom->__construct('<?xml version="...', Object(MagentoFrameworkAppArgumentsValidationState), Array, 'xsi:type', NULL)
#2 /var/www/html/vendor/magento/framework/Config/Reader/Filesystem.php(149): MagentoFrameworkObjectManagerConfigReaderDom->_createConfigMerger('Magento\Framewo...', '<?xml ve
rsion="...')
#3 /var/www/html/vendor/magento/framework/Config/Reader/Filesystem.php(130): MagentoFrameworkConfigReaderFilesystem->_readFiles(Object(MagentoFrameworkConfigFileIterator))
#4 /var/www/html/vendor/magento/framework/App/ObjectManagerFactory.php(275): MagentoFrame
workConfigReaderFilesystem->read('primary')
#5 /var" while reading response header from upstream, client: 118.209.48.25, server: tangopop.com.au, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "XX.XXX.XX.XXX"

Installed modules:

DOM     Christian Stocker, Rob Richards, Marcus Boerger 
xmlrpc
core library version    xmlrpc-epi v. 0.54
php extension version   7.2.11-4+0~20181106031710.10+jessie~1.gbp789850
author  Dan Libby
homepage    http://xmlrpc-epi.sourceforge.net
open sourced by     Epinions.com 
LIBXML, SimpleXML, XML, XMLReader, xmlrpc, XMLWriter

PHP Info Available: http://13.239.86.161/info.php

Advertisement

Answer

You need to install the php-dom and php-xml packages, however it looks like from you PHP info. that you have done so. If you are on Debian or Ubuntu you can make sure by running apt install php-dom php-xml

You likely need to restart PHP FPM or Apache for the changes to take effect – eg. systemctl restart php-fpm or systemctl restart apache2 (or systemctl restart httpd)

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement