服务器之家:专注于服务器技术及软件下载分享
分类导航

Linux|Centos|Ubuntu|系统进程|Fedora|注册表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服务器之家 - 服务器系统 - Centos - 详解Centos下YUM安装PHP的两种方式

详解Centos下YUM安装PHP的两种方式

2022-02-10 16:38全栈运维 Centos

本篇文章主要介绍了Centos下YUM安装PHP的两种方式,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

在Centos下安装PHP时, 先后使用了两种方式进行实现, 现整理出来以作记录。

摘要

一般Centos下安装软件我们采用源码安装或者RPM包安装的方式,有时候更简单我们可以采用YUM源的方式

安装PHP的时候有个特殊的地方,其有两个YUM源可供选择

Webtatic方式安装升级PHP

安装webtatic

?
1
2
3
4
5
6
7
8
[root@i-bskmtj6q ~]# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Retrieving https://mirror.webtatic.com/yum/el6/latest.rpm
Preparing...        ########################################### [100%]
  1:webtatic-release    ########################################### [100%]
[root@i-bskmtj6q ~]# ls -l /etc/yum.repos.d/webtatic*
-rw-r--r-- 1 root root 963 Nov 13 2016 /etc/yum.repos.d/webtatic-archive.repo
-rw-r--r-- 1 root root 865 Nov 13 2016 /etc/yum.repos.d/webtatic.repo
-rw-r--r-- 1 root root 963 Nov 13 2016 /etc/yum.repos.d/webtatic-testing.repo

安装或者升级PHP

?
1
2
3
4
## install
yum --enablerepo=remi install php php-*
## update
yum --enablerepo=remi update php php-*

REMI方式安装升级PHP

REMI源有个特殊的地方,安装其前必须先安装

?
1
2
3
4
[root@i-bskmtj6q ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
error: Failed dependencies:
  epel-release = 6 is needed by remi-release-6.9-1.el6.remi.noarch

安装 REMI源

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@i-bskmtj6q ~]# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
Preparing...        ########################################### [100%]
  1:epel-release      ########################################### [100%]
[root@i-bskmtj6q ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Preparing...        ########################################### [100%]
  1:remi-release      ########################################### [100%]
[root@i-bskmtj6q ~]# ls -l /etc/yum.repos.d/remi*
-rw-r--r-- 1 root root 457 Jun 30 20:13 /etc/yum.repos.d/remi-php54.repo
-rw-r--r-- 1 root root 1316 Jun 30 20:13 /etc/yum.repos.d/remi-php70.repo
-rw-r--r-- 1 root root 1316 Jun 30 20:13 /etc/yum.repos.d/remi-php71.repo
-rw-r--r-- 1 root root 1316 Jun 30 20:13 /etc/yum.repos.d/remi-php72.repo
-rw-r--r-- 1 root root 2609 Jun 30 20:13 /etc/yum.repos.d/remi.repo
-rw-r--r-- 1 root root 751 Jun 30 20:13 /etc/yum.repos.d/remi-safe.repo

安装或者升级PHP

?
1
2
3
4
## install
yum --enablerepo=webtatic install php php-*
## update
yum --enablerepo=webtatic update php php-*

说明

1、EPEL

Extra Packages for Enterprise Linux,也就是为企业级 Linux提供的扩展软件源,适用于 RHEL,CentOS,Scientific Linux系统。

2、remi

软件源对旧的fedora版本提供最新的软件支持,也可以为Centos及RHEL提供最新的软件

看官网的图标可能主要和PHP安装升级相关(个人猜测)

3、Webtatic

The Webtatic Yum repository is a CentOS/RHEL repository containing updated web-related packages. 主要供应最新LAMP等软件源

参考官网介绍 https://webtatic.com/projects/yum-repository/

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。

原文链接:http://www.jianshu.com/p/2ff15676f902?utm_source=tuicool&utm_medium=referral

延伸 · 阅读

精彩推荐
  • CentosCentOS 最新版本git的安装教程

    CentOS 最新版本git的安装教程

    本文主要给大家介绍了CentOS 最新版本git的安装教程,非常不错,具有参考借鉴价值,感兴趣的朋友一起看看吧...

    CentOS教程网9252021-11-29
  • Centos在CentOS系统上安装Docker的教程

    在CentOS系统上安装Docker的教程

    这篇文章主要介绍了在CentOS系统上安装Docker的教程,Docker是当下人气最为火热的容器类虚拟软件,需要的朋友可以参考下 ...

    开源中文社区3952019-09-17
  • Centos使用Xshell连接Centos 6.6服务器操作图文教程

    使用Xshell连接Centos 6.6服务器操作图文教程

    这篇文章主要介绍了使用Xshell连接Centos 6.6服务器操作图文教程,本文用详细的操作步骤讲解了如何使用Xshell连接Centos服务器,需要的朋友可以参考下 ...

    脚本之家4032019-09-18
  • Centoscentos 7中添加一个新用户并授权的步骤详解

    centos 7中添加一个新用户并授权的步骤详解

    这篇文章主要给大家介绍了关于在centos 7中添加一个新用户并授权的步骤,文中将实现的步骤介绍的非常详细,通过文中介绍的步骤可以轻松的创建一个新...

    Ryan.Miao9832022-02-12
  • CentosCentOS6.2网卡设置

    CentOS6.2网卡设置

    如果你想让服务器可以更新、让网友访问你的LINUX服务器,那一定要设置LINUX网上给网卡绑定一个IP,下面我们就介绍CentOS6.2网卡设置IP的方法。...

    CentOS教程网10092021-10-03
  • CentosCentOS7 阿里云的yum源使用详解

    CentOS7 阿里云的yum源使用详解

    这篇文章主要介绍了CentOS7 阿里云的yum源使用详解的相关资料,这里对备份yum源,添加EPEL源,和缓存清理,进行了介绍,需要的朋友可以参考下...

    天王9312020-12-28
  • CentosCentOS系统下软件包的制作方法和过程详解

    CentOS系统下软件包的制作方法和过程详解

    今天小编将为大家带来的是CentOS系统下软件包的制作方法和过程详解;希望对大家会有帮助,有需要的朋友一起去看看吧...

    CentOS之家4802019-05-30
  • CentosCentOS上SVN服务器端程序的安装与使用教程

    CentOS上SVN服务器端程序的安装与使用教程

    SVN是一款高人气的软件项目版本控制系统,由于其在Windows的客户端的简易操作,在Git的浪潮中仍然保有很多的用户数量,这里我们就来看一下CentOS上SVN服务器端...

    cnblogs3902019-07-16