首页 后端开发 PHP7 在 CentOS 中安装 PHP 7.4 的方法

在 CentOS 中安装 PHP 7.4 的方法

Dec 04, 2019 pm 04:09 PM
PHP 7.4

本指南提供了在 CentOS 8 / RHEL 8 Linux 系统上安装 PHP 7.4 的步骤。有兴趣的开发者已经可以在生产环境中使用使用 PHP 7.4,正式版本的官方发布时间为 2019 年 11 月 28 日。

请按照以下步骤在 CentOS 8 / RHEL 8 上安装 PHP 7.4。

步骤一:添加 EPEL 和 REMI 库

安装需要 EPEL 和 REMI 库。通过以下命令将其添加到系统中

sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
登录后复制

步骤二:在 CentOS 8 / RHEL 8 上安装 PHP 7.4

添加相关的库后,启用 PHP 7.4 的 Remi 模块并进行安装。

sudo dnf -y install dnf-utils
登录后复制

启用 PHP 7.4 的模块流

sudo dnf module install php:remi-7.4
登录后复制

接受安装提示

Updating Subscription Management repositories.
Last metadata expiration check: 0:00:24 ago on Mon 16 Sep 2019 09:36:21 AM EDT.
Dependencies resolved.
===================================
Package Arch Version Repository Size
=========================
Installing group/module packages:
php-cli x86_64 7.4.0~RC1-1.el8.remi remi-modular 4.6 M
php-common x86_64 7.4.0~RC1-1.el8.remi remi-modular 1.2 M
php-fpm x86_64 7.4.0~RC1-1.el8.remi remi-modular 1.6 M
php-json x86_64 7.4.0~RC1-1.el8.remi remi-modular 71 k
php-mbstring x86_64 7.4.0~RC1-1.el8.remi remi-modular 524 k
php-xml x86_64 7.4.0~RC1-1.el8.remi remi-modular 211 k
Installing dependencies:
nginx-filesystem noarch 1:1.14.1-8.module+el8+2505+fe936cef rhel-8-for-x86_64-appstream-rpms 24 k
oniguruma x86_64 6.8.2-1.el8 rhel-8-for-x86_64-appstream-rpms 188 k
httpd-filesystem noarch 2.4.37-11.module+el8.0.0+2969+90015743 rhel-8-for-x86_64-appstream-rpms 34 k
libxslt x86_64 1.1.32-3.el8 rhel-8-for-x86_64-baseos-rpms 249 k
Installing module profiles:
php/common
Enabling module streams:
httpd 2.4
nginx 1.14
php remi-7.4
Transaction Summary
===============================
Install 10 Packages
Total download size: 8.6 M
Installed size: 43 M
Is this ok [y/N]: y

使用如下命令安装额外的包

sudo dnf update
sudo yum install php-xxx
登录后复制

当前的 PHP 版本应该为 7.4

$ php -v
PHP 7.4.0 (cli) (built: Nov 26 2019 20:13:36) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
登录后复制

查看已启用的模块:

$ php --modules
登录后复制

你已成功在 CentOS 8 / RHEL 8 上安装 PHP 7.4。

更多相关PHP7文章请访问:《PHP7》教程

以上是在 CentOS 中安装 PHP 7.4 的方法的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解锁Myrise中的所有内容
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)