这期内容当中小编将会给大家带来有关如何在Ubuntu 18.04系统中安装PHP 7.3 7.2和7.0,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
安装PHP 7.3
通过下列命令安装PHP 7.3
$ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update $ sudo apt-get install -y php7.3
安装完成后,使用如下命令检查PHP的版本
$ php -v PHP 7.3.3-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:31:49) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.3, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.3-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
安装PHP 7.2
通过下列命令安装PHP 7.2
$ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update $ sudo apt-get install -y php7.2
安装完成后,使用如下命令检查PHP的版本
$ php -v PHP 7.2.16-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:23:29) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.16-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
安装PHP 7.1
通过下列命令安装PHP 7.1
$ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update $ sudo apt-get install -y php7.1
安装完成后,使用如下命令检查PHP的版本
$ php -v PHP 7.1.27-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:02:25) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.1.27-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
安装PHP 7.0
通过下列命令安装PHP 7.0
$ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update $ sudo apt-get install -y php7.0
安装完成后,使用如下命令检查PHP的版本
$ php -v PHP 7.0.33-5+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 8 2019 09:49:15) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.33-5+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
安装PHP 7模块
使用如下命令安装PHP 7模块
$ sudo apt-cache search php7* php-all-dev - package depending on all supported PHP development packages php7.0 - server-side, HTML-embedded scripting language (metapackage) php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary) php7.0-cli - command-line interpreter for the PHP scripting language php7.0-common - documentation, examples and common module for PHP php7.0-curl - CURL module for PHP php7.0-dev - Files for PHP7.0 module development php7.0-gd - GD module for PHP php7.0-gmp - GMP module for PHP ... ... ... php7.1-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP php7.1-xmlrpc - XMLRPC-EPI module for PHP php7.1-zip - Zip module for PHP php7.1-opcache - Zend OpCache module for PHP php7.1 - server-side, HTML-embedded scripting language (metapackage) php7.1-xsl - XSL module for PHP (dummy) ... ... php7.2-bcmath - Bcmath module for PHP php7.2-bz2 - bzip2 module for PHP php7.2-cgi - server-side, HTML-embedded scripting language (CGI binary) php7.2-cli - command-line interpreter for the PHP scripting language php7.2-common - documentation, examples and common module for PHP php7.2-curl - CURL module for PHP php7.2-dba - DBA module for PHP
用如下命令,按需安装PHP扩展模块,安装之前,确保安装正确的PHP版本。
$ sudo apt-get install php7.2-mysql php7.2-curl php7.2-json php7.2-cgi php7.2-xsl
安装完成后,现在就可以开始php开发了。
上述就是小编为大家分享的如何在Ubuntu 18.04系统中安装PHP 7.3 7.2和7.0了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注亿速云行业资讯频道。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。