NoMansLand
NoMansLand

Reputation: 39

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): Magento\Framework\Config\Dom->_initDom('<?xml version="...')
#1 /var/www/html/vendor/magento/framework/ObjectManager/Config/Reader/Dom.php(70): Magento\Framework\Config\Dom->__construct('<?xml version="...', Object(Magento\Framework\App\Arguments\ValidationState), Array, 'xsi:type', NULL)
#2 /var/www/html/vendor/magento/framework/Config/Reader/Filesystem.php(149): Magento\Framework\ObjectManager\Config\Reader\Dom->_createConfigMerger('Magento\\Framewo...', '<?xml ve
rsion="...')
#3 /var/www/html/vendor/magento/framework/Config/Reader/Filesystem.php(130): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#4 /var/www/html/vendor/magento/framework/App/ObjectManagerFactory.php(275): Magento\Frame
work\Config\Reader\Filesystem->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

Upvotes: 1

Views: 10606

Answers (2)

JUBED ALAM
JUBED ALAM

Reputation: 1

yes, one have to install 'php-dom php-xml' using the command "sudo yum install php-dom php-xml" on the putty for ec2-user. I installed using the command sudo yum install php-dom php-xml It works for me like a charm.

Upvotes: 0

Elliot Reed
Elliot Reed

Reputation: 749

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)

Upvotes: 7

Related Questions