Rohan Warwar
Rohan Warwar

Reputation: 850

PHP 7 DOMDocument not found

I tried to run the command app/console cache:clear but it gave an 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/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:52

I use PHP 7 on Ubuntu 14.04 LTS. Installing php5-dom did not resolve my problem:

sudo apt-get install php5-dom

Upvotes: 38

Views: 52412

Answers (2)

shuramaan
shuramaan

Reputation: 161

Just a minor addition to the answer. I'm using nginx with PHP 7 and php-fpm. You must restart the php-fpm service in order for the updates to work. Restarting nginx alone won't help.

Upvotes: 12

Barry Last
Barry Last

Reputation: 1236

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

Upvotes: 121

Related Questions