在 Ubuntu 14.04 上安装 php7 时遇到问题

在 Ubuntu 14.04 上安装 php7 时遇到问题

我正在使用 Ubuntu 14.04,并尝试安装 PHP 7。我做错了。我按照这些指示

如果我在终端中输入“php -v”,它会显示 php 7。

但是,如果我查看我的 phpinfo(),输出仍然显示我的旧 php 5。

现在,当我尝试安装需要 php 7 的东西时,出现以下错误:

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

        Problem 1
          - Installation request for alchemy/zippy 0.3.5 -> satisfiable by 
alchemy/zippy[0.3.5].
          - alchemy/zippy 0.3.5 requires ext-mbstring * -> the requested PHP 
extension mbstring is missing from your system.
        Problem 2
          - Installation request for easyrdf/easyrdf 0.9.1 -> satisfiable by 
easyrdf/easyrdf[0.9.1].
          - easyrdf/easyrdf 0.9.1 requires ext-mbstring * -> the requested 
PHP extension mbstring is missing from your system.
        Problem 3
          - Installation request for phpunit/phpunit 4.8.27 -> satisfiable by
 phpunit/phpunit[4.8.27].
          - phpunit/phpunit 4.8.27 requires ext-dom * -> the requested PHP 
extension dom is missing from your system.
        Problem 4
          - alchemy/zippy 0.3.5 requires ext-mbstring * -> the requested PHP 
extension mbstring is missing from your system.
          - drupal/console 0.11.3 requires alchemy/zippy 0.3.5 -> satisfiable
 by alchemy/zippy[0.3.5].
          - Installation request for drupal/console 0.11.3 -> satisfiable by 
drupal/console[0.11.3].

        To enable extensions, verify that they are enabled in those .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-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
        You can also run `php --ini` inside terminal to see which files are
 used by PHP in CLI mode.

有人知道我需要修复什么才能在我的系统上运行 php 7 吗?

答案1

您粘贴的错误输出说明了一切 - 您缺少mbstringdom扩展。可以使用以下方法安装它们:

sudo apt-get install php7.0-dom php7.0-mbstring

具有 PHP 扩展的包具有正确的Provides:字段,因此将选择正确的包。

相关内容