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