centos/RHEL 7.6 使用yum安装php7.3(方便wordpress的php7.3需求,并解决了libphp7.so缺失问题)

PHP7.3是PHP最新的稳定发行版,很多流行的yum仓库都提供php7的rpm安装包,这篇文章用Remi和EPEL仓库将安装包安装至你的系统。这篇文章帮你将PHP7.3, 7.2, 7.1服务安装至你的系统,这篇教程经过了centos7.4.1708的测试(实际上译者用7.6也可用)。

 

设置你的yum仓库

  首先,你需要安装remi和EPEL仓库,使用下面的命令安装:

安装EPEL:

sudo yum install epel-release

安装remi:

sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

  

安装PHP7

(译者:根据需求选择一个指令即可)

## 安装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 

我安装了php7.3, 通过下面指令检测是否正确运行:

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模块,下面是一些有用的模块的安装指令。(译者:如果你不安装,就会缺这缺那,比方说libphp7.so)

### 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

  你也可以通过下面的指令搜寻一些其它php模块,下面的示例指令将列出remi仓库下所有PHP7.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
php73-php-componere.x86_64 : Composing PHP classes at runtime
php73-php-dba.x86_64 : A database abstraction layer module for PHP applications
php73-php-dbg.x86_64 : The interactive PHP debugger
php73-php-devel.x86_64 : Files needed for building PHP extensions
php73-php-embedded.x86_64 : PHP library for embedding in applications
php73-php-enchant.x86_64 : Enchant spelling extension for PHP applications
php73-php-fpm.x86_64 : PHP FastCGI Process Manager
php73-php-gd.x86_64 : A module for PHP applications for using the gd graphics
...
...
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值