centos7升级php版本
1. 概述
本篇博客主要记录如何在centos7.9升级php版本。
2. 操作过程
添加php的yum源rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
在/etc/yum.repo.d
目录下,能够看到多出很多源
$ ls -lrt remi*
-rw-r--r-- 1 root root 750 2月 15 2022 remi-safe.repo
-rw-r--r-- 1 root root 2605 2月 15 2022 remi.repo
-rw-r--r-- 1 root root 1314 2月 15 2022 remi-php81.repo
-rw-r--r-- 1 root root 1314 2月 15 2022 remi-php80.repo
-rw-r--r-- 1 root root 1314 2月 15 2022 remi-php74.repo
-rw-r--r-- 1 root root 1314 2月 15 2022 remi-php73.repo
-rw-r--r-- 1 root root 1314 2月 15 2022 remi-php72.repo
-rw-r--r-- 1 root root 1314 2月 15 2022 remi-php71.repo
-rw-r--r-- 1 root root 1314 2月 15 2022 remi-php70.repo
-rw-r--r-- 1 root root 456 2月 15 2022 remi-php54.repo
-rw-r--r-- 1 root root 855 2月 15 2022 remi-modular.repo
-rw-r--r-- 1 root root 446 2月 15 2022 remi-glpi94.repo
-rw-r--r-- 1 root root 446 2月 15 2022 remi-glpi93.repo
-rw-r--r-- 1 root root 446 2月 15 2022 remi-glpi92.repo
-rw-r--r-- 1 root root 446 2月 15 2022 remi-glpi91.repo
要安装或者升级到php7.4,做以下修改vim remi-php74.repo
,把enabled=0
修改为enabled=1
然后执行yum clean all && yum makecache
安装httpd服务:yum -y install httpd
安装php环境:yum -y install php php-mysqlnd php-bcmath php-mbstring php-gd php-png php-jpeg php-gif php-xmlwriter php-xmlreader php-ldap
查看结果
$ rpm -qa|grep php
php-xml-7.4.30-1.el7.remi.x86_64
php-json-7.4.30-1.el7.remi.x86_64
php-mbstring-7.4.30-1.el7.remi.x86_64
php-7.4.30-1.el7.remi.x86_64
php-mysqlnd-7.4.30-1.el7.remi.x86_64
php-ldap-7.4.30-1.el7.remi.x86_64
php-common-7.4.30-1.el7.remi.x86_64
php-pdo-7.4.30-1.el7.remi.x86_64
php-sodium-7.4.30-1.el7.remi.x86_64
oniguruma5php-6.9.8-1.el7.remi.x86_64
php-gd-7.4.30-1.el7.remi.x86_64
php-bcmath-7.4.30-1.el7.remi.x86_64
php-cli-7.4.30-1.el7.remi.x86_64
gd3php-2.3.3-7.el7.remi.x86_64
php-png php-jpeg php-gif这三个似乎没有
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南