Steve Downey
Steve Downey

Reputation: 71

Fatal error: Class 'DOMDocument' not found, in a Wordpress site

In my wordpress site I get the error "Fatal error: Class 'DOMDocument' not found"

php-xml not being installed on the server can cause the issue but it's already installed (I'm using Centos)

I've also added "extension=dom.so" to the php.ini but it's still not working

Thanks

Upvotes: 5

Views: 10778

Answers (1)

Naveen Giri
Naveen Giri

Reputation: 545

DOM is PHP module. This error usually occur when we not have this php module installed. Dom listed in phpinfo you can get this information by running phpinfo() function on any php file.

There are few way to debug and fix this issue. - first install php-xml package

sudo apt-get install php-xml

then after restarting your apache server

sudo service apache restart

If still this issue is not fixed. check your php version and install appropriate php-xml module for it for example: for php 7.0

apt-get install php7.0-xml

Upvotes: 8

Related Questions