35
votes

I try run command: app/console cache:clear

This return me error:

An error occurred when executing the "'cache:clear --no-warmup'" command:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowable
Error: Fatal error: Class 'DOMDocument' not found in /var/www/html/vendor/s
ymfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:52

Ubuntu 14.04 LTS I use PHP 7 and install php5-dom not resolved my problem:

sudo apt-get install php5-dom
2
Do you have xml module for php in your system ??Drudge Rajen
Note that it may be necessary to sudo service apache2 restart after installing the package.BurninLeo

2 Answers

120
votes

I had the same issue on Ubuntu and fixed it doing the following

apt-get install php-xml

or

sudo apt-get install php-xml

if not as root

12
votes

just a minor addition to the answer. i'm using nginx with php version 7 and php-fpm. you must restart the php-fpm service in order for the updates to work, restarting nginx alone won't help