您的位置 首页 php

如何在CentOS / RHEL 6.10上安装PHP( 7.3,7.2,7.1)?

PHP 7.3是PHP最新的稳定版本。本文将给大家介绍如何在 CentOS 和Redhat 6.10系统上安装PHP 7.3、PHP 7.2、PHP 7.1。

配置yum库

首先,需要在系统上启用Remi和EPEL yum存储库。使用以下命令在CentOS和Red Hat 7/6系统上安装EPEL存储库

使用此命令安装epel-release yum存储库

# yum install epel-release

现在根据你的操作系统版本执行以下命令之一来安装Remi 存储库。

$ rpm -Uvh

在CentOS 6上安装PHP 7

你的系统已经为从yum存储库安装PHP做好了准备。根据需要,使用以下命令之一在系统上安装PHP 7.3或PHP 7.2或PHP 7.1。

## 安装PHP 7.3

$ yum –enablerepo=remi-php73 install php

## 安装PHP 7.2

$ yum –enablerepo=remi-php72 install php

## 安装PHP 7.1

$ yum –enablerepo=remi-php71 install php

我已经在我的系统上安装了最新版本的PHP 7.3。现在运行以下命令来检查系统的当前使用的PHP版本。

$ php -v

PHP 7.3.0 (cli) (built: Dec 4 2018 16:12:20) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

安装PHP模块

你还可能需要根据你的应用程序需求安装额外的PHP模块。

下面的命令将安装一些有用的PHP模块。

### For PHP 7.3

$ yum –enablerepo=remi-php73 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

### For PHP 7.2

$ yum –enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

### For PHP 7.1

$ yum –enablerepo=remi-php71 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

你可以运行以下命令,在已配置的yum存储库下搜索其他可用的PHP模块。

下面的示例命令搜索PHP 7.3的所有模块。

$ yum –enablerepo=remi-php73 search php | grep php73

php73.x86_64 : Package that installs PHP 7.3

php73-php.x86_64 : PHP scripting language for creating dynamic web sites

php73-php-bcmath.x86_64 : A module for PHP applications for using the bcmath

php73-php-brotli.x86_64 : Brotli Extension for PHP

php73-php-cli.x86_64 : Command-line interface for PHP

php73-php-common.x86_64 : Common files for PHP

相关推荐:《PHP教程》

本篇文章就是关于在CentOS / RHEL 6.10上安装PHP( 7.3,7.2,7.1)的方法步骤介绍,希望对需要的朋友有所帮助!

以上就是如何在CentOS / RHEL 6.10上安装PHP( 7.3,7.2,7.1)?的详细内容,更多请关注其它相关文章!

更多技巧请《转发 + 关注》哦!

文章来源:智云一二三科技

文章标题:如何在CentOS / RHEL 6.10上安装PHP( 7.3,7.2,7.1)?

文章地址:https://www.zhihuclub.com/78830.shtml

关于作者: 智云科技

热门文章

网站地图