13

I am running Linux Mint 18.1. My IDE is PhpStorm and I am trying to install PHPUnit trough the composer. I followed the installation steps at https://getcomposer.org/download/.

Problem 1 - Installation request for phpunit/phpunit 6.4.x-dev -> satisfiable by phpunit/phpunit[6.4.x-dev]. - phpunit/phpunit 6.4.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 2 - symfony/symfony v3.3.6 requires ext-xml * -> the requested PHP extension xml is missing from your system. - symfony/symfony v3.3.6 requires ext-xml * -> the requested PHP extension xml is missing from your system. - symfony/symfony v3.3.6 requires ext-xml * -> the requested PHP extension xml is missing from your system. - Installation request for symfony/symfony (locked at v3.3.6, required as 3.3.*) -> satisfiable by symfony/symfony[v3.3.6].

Solutions I have tried:

  • Install php-xml
  • Install php7.0-xml
  • This answer says to check if "extension=dom.so" is enabled in any of your php.ini files. It is not even present in my files

Any suggestions? Thanks a lot!

BFMC2
  • 145
  • 1
  • 1
  • 6

1 Answers1

32

All you need to install from your terminal in Debian is:

sudo apt-get install php-xml

Or, if you're using PHP 7:

 sudo apt-get install php7.0-xml
automatix
  • 14,018
  • 26
  • 105
  • 230
Malek Zarkouna
  • 943
  • 10
  • 21
  • 1
    Hi, thanks for your response but one of the first things I did was check if those were installed and they are, and updated to the latest version. – BFMC2 Aug 09 '17 at 17:39
  • sudo apt-get install php-mbstring "i guess you are missing mbstring" than composer update "update your composer " – Malek Zarkouna Aug 09 '17 at 23:53
  • Also have php-mbstring installed. Composer was always the latest version. – BFMC2 Aug 10 '17 at 11:08
  • It turns out there was something off with my composer installation. See this [question](https://stackoverflow.com/questions/45585073/phpunit-working-in-ide-but-server-says-class-not-found) for if you want to know how I fixed this. – BFMC2 Aug 10 '17 at 13:09
  • good for you , i m glad you fixed your issue . – Malek Zarkouna Aug 10 '17 at 13:14
  • It worked for me. But it'd probably not work for someone else (pretty much everybody else), so -1. – Chris Vilches Sep 29 '17 at 01:13
  • 2
    For php 7.2 you can use `sudo apt-get install php7.2-xml` to install the correct version .. i think this works too with 7.1 – MonTea Sep 06 '18 at 21:24
  • Of course, for php 7.3 : `sudo apt-get install php7.3-xml` :) – Guillaume Harari Jan 30 '20 at 15:18