306-Ubuntu18.04&16.04安装PHP(7.0|7.1|7.2|7.3)

字数 52阅读 3814

安装 PHP 7.3 on Ubuntu

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.3

查看PHP版本:

php -v 

PHP 7.3.0-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Dec  6 2018 20:24:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

安装 PHP 7.2 on Ubuntu

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.2

查看PHP版本:

php -v 

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

安装 PHP 7.1 on Ubuntu

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1

查看PHP版本:

php -v 

PHP 7.1.24-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Nov 12 2018 09:23:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.24-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

安装 PHP 7.0 on Ubuntu

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.0

查看PHP版本:

php -v 

PHP 7.0.32-4+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Nov  4 2018 05:11:17) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.32-4+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

推荐阅读更多精彩内容