如何在Ubuntu 16.04上安装PHP 7.1 yaml扩展而不是7.2

时间:2018-04-19 02:54:30

标签: php yaml ubuntu-16.04

我正在尝试在Ubuntu上安装yaml扩展。

我的服务器上有PHP 7.1。

ubuntu@www1:~$ php -v
PHP 7.1.15-1+ubuntu14.04.1+deb.sury.org+2 (cli) (built: Mar  6 2018 11:27:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.15-1+ubuntu14.04.1+deb.sury.org+2, Copyright 
    (c) 1999-2018, by Zend Technologies

我正在关注另一个说要运行的SO帖子

sudo apt install libyaml-dev php-dev php-pear

当我这样做时,安装人员会说:

The following extra packages will be installed:
  dh-php php7.2-cli php7.2-common php7.2-dev php7.2-json php7.2-opcache
  php7.2-readline pkg-php-tools xml2
Suggested packages:
  dh-make
The following NEW packages will be installed:
  dh-php php-dev php7.2-cli php7.2-common php7.2-dev php7.2-json
  php7.2-opcache php7.2-readline pkg-php-tools xml2
0 upgraded, 10 newly installed, 0 to remove and 85 not upgraded.
Need to get 3,073 kB of archives.
After this operation, 18.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

那么,为什么安装程序会在PHP 7.1服务器上安装PHP 7.2扩展?

我中止了安装并来到这里询问:

如何强制我的服务器保持在PHP 7.1并安装yaml扩展名?

1 个答案:

答案 0 :(得分:1)

你试过吗

sudo apt-get install -y php7.1-yaml