Home » Php » wordpress – How do I enable the DOM extension in the php.ini

wordpress – How do I enable the DOM extension in the php.ini

Posted by: admin July 12, 2020 Leave a comment

Questions:

How do I enable the DOM extension in my php.ini file? I am running a WordPress site and getting a message “Please enable the DOM extension in your PHP configuration”.

Do I need to edit the wp-config file or php.ini

How to&Answers:

You need to install php-xml

and then add

extension=dom.so 

to the php.ini file.

docs in php.net

Please note that the extension is enabled by default. It might be disabled because of the following option: –disable-dom

Answer:

You need to install php-xml.

sudo apt-get install php-xml

Restart your server (here apache).

sudo service apache2 restart

And you can check that everything is OK using :

php -m

Resulting :

[PHP Modules]
...
dom < and other relatives modules as xml, xmlreader, SimpleXML...
...

[Zend Modules]
Zend OPcache