redhat yum安装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 http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

在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)的方法步骤介绍,希望对需要的朋友有所帮助!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值