ubuntu 16.04 安装laravel 出错

当安装laravel 时出现这堆错误:

Your requirements could not be resolved to an installable set of packages.

Problem 1
– phpunit/phpunit 5.7.9 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.21 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.20 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.19 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.18 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.17 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.16 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.15 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.14 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.13 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.12 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.11 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.10 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– phpunit/phpunit 5.7.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
– Installation request for phpunit/phpunit ~5.7 -> satisfiable by phpunit/phpunit[5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.21, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9].

To enable extensions, verify that they are enabled in your .ini files:
– /etc/php/7.0/cli/php.ini
– /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
– /etc/php/7.0/cli/conf.d/10-opcache.ini
– /etc/php/7.0/cli/conf.d/10-pdo.ini
– /etc/php/7.0/cli/conf.d/20-calendar.ini
– /etc/php/7.0/cli/conf.d/20-ctype.ini
– /etc/php/7.0/cli/conf.d/20-exif.ini
– /etc/php/7.0/cli/conf.d/20-fileinfo.ini
– /etc/php/7.0/cli/conf.d/20-ftp.ini
– /etc/php/7.0/cli/conf.d/20-gd.ini
– /etc/php/7.0/cli/conf.d/20-gettext.ini
– /etc/php/7.0/cli/conf.d/20-iconv.ini
– /etc/php/7.0/cli/conf.d/20-json.ini
– /etc/php/7.0/cli/conf.d/20-mbstring.ini
– /etc/php/7.0/cli/conf.d/20-mysqli.ini
– /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
– /etc/php/7.0/cli/conf.d/20-phar.ini
– /etc/php/7.0/cli/conf.d/20-posix.ini
– /etc/php/7.0/cli/conf.d/20-readline.ini
– /etc/php/7.0/cli/conf.d/20-shmop.ini
– /etc/php/7.0/cli/conf.d/20-sockets.ini
– /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
– /etc/php/7.0/cli/conf.d/20-sysvsem.ini
– /etc/php/7.0/cli/conf.d/20-sysvshm.ini
– /etc/php/7.0/cli/conf.d/20-tokenizer.ini
– /etc/php/7.0/cli/conf.d/20-zip.ini
You can also run `php –ini` inside terminal to see which files are used by PHP in CLI mode.

 

执行命令:

sudo apt-get install php-xml

 

后重新安装就可以了。

留下评论