Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class 'DOMDocument' not found

I've found an error on a page in my Magento application; it always show this message error when I visit it:

Fatal error: Class 'DOMDocument' not found in /home/.../lib/Zend/Feed/Abstract.php on line 95

Can you give me a solution? I'm using magento 1.4.1.1.

like image 931
ws_123 Avatar asked Jan 18 '13 08:01

ws_123


4 Answers

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

sudo apt-get install php-dom

And on Centos / Fedora / Red Hat:

yum install php-xml

If you get conflicts between PHP packages, you could try to see if the specific PHP version package exists instead: e.g. php53-xml if your system runs PHP5.3.

like image 178
Dean Avatar answered Nov 01 '22 21:11

Dean


PHP 8.1

  • Ubuntu: apt-get install php8.1-xml
  • CentOS 8 [with php:remi-8.1 enabled]: dnf install php-xml

PHP 8.0

  • Ubuntu: apt-get install php8.0-xml
  • CentOS 8 [with php:remi-8.0 enabled]: dnf install php-xml

PHP 7.4:

  • Ubuntu: apt-get install php7.4-xml
  • CentOS / Fedora / Red Hat: yum install php74w-xml
like image 41
Limon Monte Avatar answered Nov 01 '22 23:11

Limon Monte


PHP8: (latest version)

sudo apt-get install php8.0-xml

PHP7:

sudo apt-get install php7.1-xml

You can also do:

sudo apt-get install php-dom

and apt-get will show you where it is.

like image 30
Albert s Avatar answered Nov 01 '22 23:11

Albert s


Package php-dom is a virtual package provided by:
  php7.1-xml 7.1.3+-3+deb.sury.org~xenial+1
  php7.0-xml 7.0.17-3+deb.sury.org~xenial+1
  php5.6-xml 5.6.30-9+deb.sury.org~xenial+1
You should explicitly select one to install.

In case anyone using 5.6 versions then go with this way

sudo apt-get install php5.6-xml

For PHP ver PHP7, Ubuntu:

sudo apt-get install php7.1-xml

or by

yum install php-xml
like image 10
inrsaurabh Avatar answered Nov 01 '22 22:11

inrsaurabh