Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

dom

php

wordpress

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

like image 798
Steve Downey Avatar asked Apr 29 '16 07:04

Steve Downey


1 Answers

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
like image 55
Naveen Giri Avatar answered Sep 22 '22 07:09

Naveen Giri