【问题标题】:How to fix issue for install laravel 5.6?如何解决安装 laravel 5.6 的问题?
【发布时间】:2018-07-27 09:53:03
【问题描述】:

我在 ubuntu 16.04 中将 PHP 7.0 升级到 7.1。

我需要安装 laravel 5.6,但显示此错误:

但是在终端运行 composer create-project --prefer-dist laravel/laravel blog 后会显示这个错误:

Installing laravel/laravel (v5.6.0)
- Installing laravel/laravel (v5.6.0): Loading from cache
Created project in orouji6
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
   - phpunit/phpunit 7.1.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
   - phpunit/phpunit 7.0.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
   - phpunit/phpunit 7.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
   - phpunit/phpunit 7.0.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
   - Installation request for phpunit/phpunit ~7.0 -> satisfiable by phpunit/phpunit[7.0.0, 7.0.1, 7.0.x-dev, 7.1.x-dev].

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

如何解决这个问题? 谢谢

【问题讨论】:

  • 你读完最后一行了吗?那里的PHP版本是什么?

标签: laravel laravel-5


【解决方案1】:

你需要安装php dom扩展。

sudo apt-get install php7.1-xml

【讨论】:

    【解决方案2】:

    您缺少dom PHP 扩展。您需要安装它才能使用 phpunit 版本 7 及更高版本(Laravel 5.6 在开发环境中需要)。

    如果您使用的是 Debian 或 Ubuntu,您可以使用 apt install php7.1-xml 安装它。

    【讨论】:

      猜你喜欢
      • 2020-06-15
      • 2020-02-29
      • 2018-08-06
      • 1970-01-01
      • 2021-07-14
      • 2019-11-16
      • 2021-03-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多