如何在Debian 8/7上使用PPA安装PHP 7.0和5.6
Debian    2018-12-04 17:02:50    290    0    0
admin   Debian

在系统中添加PPA

首先,您需要在您的系统上添加Dotdeb PPA。在添加PPA之前,首先导入Dotdeb存储库的GPG密钥。

  1. $ sudo apt-get install curl
  2. $ curl https://www.dotdeb.org/dotdeb.gpg | sudo apt-key add -

现在使用以下命令在系统中添加PPA。

首先,使用命令 lsb_release -a 查看Debian的版本号:

  1. $ lsb_release -a
  2. LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
  3. Distributor ID: Debian
  4. Description: Debian GNU/Linux 8.10 (jessie)
  5. Release: 8.10
  6. Codename: jessie

Debian 8 Jessie

  1. $ echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list
  2. $ echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list

Debian 7 Wheezy

  1. $ echo 'deb http://packages.dotdeb.org wheezy all' >> /etc/apt/sources.list
  2. $ echo 'deb-src http://packages.dotdeb.org wheezy all' >> /etc/apt/sources.list

安装PHP 7.0

使用以下命令集在PHP 7中为您的Ubuntu系统添加PPA并安装它。

  1. $ sudo apt-get update
  2. $ sudo apt-get install php7.0

现在使用以下命令检查您的系统上安装的php版本。

  1. $ php -v
  2. PHP 7.0.15-1~dotdeb+8.1 (cli) ( NTS )
  3. Copyright (c) 1997-2017 The PHP Group
  4. Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
  5. with Zend OPcache v7.0.15-1~dotdeb+8.1, Copyright (c) 1999-2017, by Zend Technologies

安装PHP 5.6

使用以下命令集在Debian系统中为PHP 5.6添加PPA并安装它。

  1. $ sudo apt-get update
  2. $ sudo apt-get install php5

现在使用以下命令检查您的系统上安装的php版本。

  1. $ php -v
  2. PHP 5.6.29-0+deb8u1 (cli) (built: Dec 13 2016 16:02:08)
  3. Copyright (c) 1997-2016 The PHP Group
  4. Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
  5. with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Prev: Linux磁盘空间查看命令

Next: Linux提示 /usr/bin/ld:cannot find-lxxx 系列解决方法

290
Table of content