Fix Class ‘DOMDocument’ not found error

Español English

If you are using the DOMDocument in your projects and get this error:

PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found

after installing PHP in Ubuntu 18.04 you can fix it installing php-xml package

$ sudo apt install php-xml

For mod_php restart the Apache server

$ sudo systemctl restart apache2

For php_fpm restart the fpm service

$ sudo systemctl restart php-fpm

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.