Magento – Magento 2.2 Command line error after installation

command linefatal errorinstallationmagento2.2php-7

I have installed fresh magento 2.2 which is working fine but command lines are not working. I am using ubuntu.

Getting strange error:

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

Did search but not found any solution. As magento 2.2 is successfully installed so it fulfilled all required settings which magento 2.2 required. What could be the issue?

Any help would be appreciated.

Best Answer

You need to install all php module as per required of Magento2. For this error it seems you have not installed php-xml module.

So install module by below command

sudo apt-get install php-xml

There is a list of module that you will need to install before Magento2 installation

   PDO/MySQL
   mbstring
   mcrypt
   mhash
   curl
   gd2
   soap
   simplexml

For PHP 7 run below commands

sudo apt-get update

sudo apt-get install php7.0-mcrypt php7.0-gd php7.0-intl php7.0-curl php7.0-xsl php7.0-mbstring php7.0-openssl php7.0-zip php7.0-soap

sudo service apache2 restart

Hope this will help you.

Related Topic