1. 起因
内网有一台服务器需要升级php版本,维护的同学又不想二进制安装.服务器只有一个光盘的yum仓库
2. 解决方法
解决思路如下:
- 外网找一台机器配置php8.3.8的仓库
- 外网服务器下载软件集并打包
- 内网服务器上传并解压实现升级
2.1 下载php8.3.8仓库
- 配置php仓库
root@centos7:~/php_install# cat /etc/yum.repos.d/remi.repo
# This repository is safe to use with RHEL/CentOS base repository
# it only provides additional packages for the PHP stack
# all dependencies are in base repository or in EPEL
[remi-safe]
name=Safe Remi's RPM repository for Enterprise Linux 7 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/safe/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/7/safe/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/7/safe/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
[remi-safe-debuginfo]
name=Remi's RPM repository for Enterprise Linux 7 - $basearch - debuginfo
baseurl=http://rpms.remirepo.net/enterprise/7/debug-remi/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
- 安装yum-utils
yum install yum-utils
- 下载php8.3.8
mkdir /root/php_install/
yumdownloader --resolve --destdir=/root/php_install/ php83-php.x86_64
tar czvf php_install.tar /root/php_install
4. 下载压缩包
sz php_install.tar
2.2 安装
tar xf php_install.tar
# 由于服务器的httpd服务不需要升级
mv php_install/httpd-* /root/
yum install -y php_install/*
3. 确认版本
rpm -qa|grep php8.3
php83 --version