Ubuntu16.0(18.04)安装php(7.0 7.1 7.3.7.4)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu16.0(18.04)安装php(7.0 7.1 7.3.7.4)相关的知识,希望对你有一定的参考价值。
Ubuntu安装php
-
1、安装 PHP 7.4 on Ubuntu
Ubuntu添加ppa源
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
查看源中的版本:
sudo apt list | grep php
安装php7.4
sudo apt-get install -y php7.4
查看PHP版本:
php -v
2、安装 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.19-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 12 2020 07:48:10) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
3、安装 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-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 12 2020 07:48:10) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
4、安装 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+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 12 2020 07:48:10) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
5、安装 PHP 7.0 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-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 12 2020 07:48:10) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
以上是关于Ubuntu16.0(18.04)安装php(7.0 7.1 7.3.7.4)的主要内容,如果未能解决你的问题,请参考以下文章
在 Ubuntu 18.04 中对 PHP 7.2 启用 GD 支持
Armbian-Ubuntu18.04安装Nginx、PHP7.2和可道云
如何从安装在 Ubuntu 18.04 VirtualBox 上的 Wordpress Web 界面写入/上传