5

On Ubuntu 16.04, I installed Drush using Composer: composer global require drush/drush:~8. Installation succeeded, but running drush --version, I got this error:

PHP Fatal error: Uncaught ReflectionException: Class DOMDocument does not exist in /.../composer/vendor/consolidation/output-formatters/src/Transformations/DomToArraySimplifier.php:24

What do I do now?

13

DOMDocument is included in the extension php-xml. To install it on ubuntu, run:

sudo apt-get install php-xml
1

Same problem on my machine, where I have php-5.6 and php-7.0 installed.

To fix this issue I have installed php5.6-xml and php7.0-xml too.

  • this was helpful. – nizz0k Nov 11 '18 at 6:51
0

Checking your php version first by command line:

php -v

and install the corresponding php-xml extension (eg: php5.6-xml; php7.0-xml; php7.1-xml; php7.2-xml).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.