cancel
Showing results for 
Search instead for 
Did you mean: 

PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/mage

PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/mage

caner@vegan:/var/www/html/magento$ sudo php bin/magento setup:upgrade
PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/magento/framework/Config/Dom.php:377
Stack trace:
#0 /var/www/html/magento/vendor/magento/framework/Config/Dom.php(109): Magento\Framework\Config\Dom->_initDom('<?xml version="...')
#1 /var/www/html/magento/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/magento/vendor/magento/framework/Config/Reader/Filesystem.php(146): Magento\Framework\ObjectManager\Config\Reader\Dom->_createConfigMerger('Magento\\Framewo...', '<?xml version="...')
#3 /var/www/html/magento/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#4 /var/www/html/magento/vendor/magento/framework/App/ObjectManagerFactory.php(282): Magento\Framework\Config\Reader\Filesystem->read('prim in /var/www/html/magento/vendor/magento/framework/Config/Dom.php on line 377
caner@vegan:/var/www/html/magento$ 

when i try to install from beginning, i tried to do upgrade.

 

because i have

 

One or more indexers are invalid. Make sure your Magento cron job is running.

error

 

and only 

 

	Catalog Rule Product	Indexed rule/product association	
UPDATE ON SAVE
REINDEX REQUIRED
Sep 6, 2016, 2:53:15 PM

is reindex requiired.

 

SO i searched for this error and  upgrading was suggested.

 

magento official docs are so complicated and meaningless, i couldn nderstand anything.

I just want to add a plugin to magento.

7 REPLIES

Re: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/

Hello CursedChico,

 

You need to install the DOM extension. You can do so on Debian / Ubuntu using:  

sudo apt-get install php5-dom

If you get conflicts between PHP 5 and PHP 5.3 packages, you could try to see if the php53-xml package exists instead.

Note Please check PHP version before your installation. If you are using PHP7 then follow this tutorial

and finally restart your apache.

Re: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/

When i do

 

caner@vegan:~$ sudo apt-get install php5-dom
[sudo] password for caner: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php5-dom

 

 i got error

Re: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/

Please run sudo apt-get update then install php5-dom.

make sure you are using php5.

Re: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/

YEs sir, i did it. After it

 

caner@vegan:~$ sudo apt-get install php5-xml
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php5-xml
caner@vegan:~$ sudo apt-get install php5.6-xml
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php5.6-xml is already the newest version (5.6.25-2+deb.sury.org~xenial+1).
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
caner@vegan:~$ 

i have 5.6 and 7 but i use 5.6 for magnto. with 7, i got errors because.

Re: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/

Hi,

I am also in same exact situation and none of my command line tools are working. Any resolution found on this?

Re: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/

Hello Niranjan,

Basically, Magento need php extension for the execution. So you must need to install the php extesion. Dom one of the php extension so install the php dom extension according to your version and make sure this is enable.

Re: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/magento/vendor/

By installing two packages it will solve the issue,

 

sudo apt-get install php7.0-imap
sudo apt-get install php-xml