Rocky Linux 9.1 安装 PHP Remi 源

作者: 温新

分类: 【Linux】

阅读: 1656

时间: 2023-03-08 16:23:33

hi,我是温新,一名 PHPer

如何快速安装最新版 PHP?源码安装?二进制安装?本篇文章将介绍使用 Remi 源快速安装自己想要的 PHP 版本。

Remi 源

官方网址:http://rpms.remirepo.net

Remi 源维护了大量 PHP 软件包。其主要目标是提供最新版本的 PHP 安装包,并对 PHP 提供全方位支持。

简单地说,可以用它安装自己想要的 PHP 版本。

Rocky Linux 9.1 安装 Remi 源

第一步:安装 EPEL 源

Remi 源依赖于 EPEL 源,因此首先要安装 EPEL 源。

# Rocky Linux 9.1 安装 EPEL
sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

第二步:安装 Remi 源

# 可以换成国内镜像
sudo dnf -y install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
# 安装 dnf-utils 包,提供启用、禁用源等实用功能
sudo dnf -y install dnf-utils

Remi 源安装完成后,会在 /etc/yum.repos.d 目录中生成remi.reporemi-safe.repo 等文件。

请登录后再评论