-
如何在CentOS中安装PHP7.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。
原文地址:https://computingforgeeks.com/how-to-install-php-7-4-on-centos-rhel-8/
栏目列表
最新更新
nodejs爬虫
Python正则表达式完全指南
爬取豆瓣Top250图书数据
shp 地图文件批量添加字段
爬虫小试牛刀(爬取学校通知公告)
【python基础】函数-初识函数
【python基础】函数-返回值
HTTP请求:requests模块基础使用必知必会
Python初学者友好丨详解参数传递类型
如何有效管理爬虫流量?
SQL SERVER中递归
2个场景实例讲解GaussDB(DWS)基表统计信息估
常用的 SQL Server 关键字及其含义
动手分析SQL Server中的事务中使用的锁
openGauss内核分析:SQL by pass & 经典执行
一招教你如何高效批量导入与更新数据
天天写SQL,这些神奇的特性你知道吗?
openGauss内核分析:执行计划生成
[IM002]Navicat ODBC驱动器管理器 未发现数据
初入Sql Server 之 存储过程的简单使用
这是目前我见过最好的跨域解决方案!
减少回流与重绘
减少回流与重绘
如何使用KrpanoToolJS在浏览器切图
performance.now() 与 Date.now() 对比
一款纯 JS 实现的轻量化图片编辑器
关于开发 VS Code 插件遇到的 workbench.scm.
前端设计模式——观察者模式
前端设计模式——中介者模式
创建型-原型模式