
[root@iZ23wv7v5ggZ ~]# php -v
PHP 7.4.0 (cli) (built: Dec 5 2019 11:56:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605$ php -v
PHP 8.1.18 (cli) (built: Apr 14 2023 04:39:24) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies

<pre class="wp-block-syntaxhighlighter-code">
[root@iZ23wv7v5ggZ ~]# cd /etc/yum.repos.d/
[root@iZ23wv7v5ggZ yum.repos.d]# ls -l
total 8
-rw-r--r-- 1 root root 2523 Jan 28 2022 CentOS-Base.repo
-rw-r--r-- 1 root root 664 Jan 28 2022 epel.repo
[root@iZ23wv7v5ggZ yum.repos.d]# rm -rf /etc/yum.repos.d/*.repo
[root@iZ23wv7v5ggZ yum.repos.d]# ls -l
total 0
[root@iZ23wv7v5ggZ yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7221 100 7221 0 0 3763 0 0:00:01 0:00:01 --:--:-- 3762
[root@iZ23wv7v5ggZ yum.repos.d]# curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7215 100 7215 0 0 11531 0 --:--:-- --:--:-- --:--:-- 11525
[root@iZ23wv7v5ggZ yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
File contains no section headers.
file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n'
[root@iZ23wv7v5ggZ yum.repos.d]# ls -l
total 16
-rw-r--r-- 1 root root 7221 Jun 6 14:32 CentOS-Base.repo
-rw-r--r-- 1 root root 7215 Jun 6 14:32 epel.repo
[root@iZ23wv7v5ggZ yum.repos.d]#
</pre>

![打开 https://mirrors.aliyun.com/repo/ ,确认源 Centos-7.repo 与 epel-7.repo 是可以下载的。决定手动编辑保存内容,然后更新缓存。报错:[Errno 14] HTTP Error 502 - Bad Gateway](https://media.shuijingwanwq.com/2023/07/4-3.png)
[root@iZ23wv7v5ggZ yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.cloud.aliyuncs.com
* extras: mirrors.cloud.aliyuncs.com
* updates: mirrors.cloud.aliyuncs.com
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyun.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyun.com/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
Metadata Cache Created

[root@iZ23wv7v5ggZ yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyun.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyun.com/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 502 - Bad Gateway
Trying other mirror.
Metadata Cache Created


[root@iZ23wv7v5ggZ ~]# wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --nginx_option 1 --php_option 11 --phpcache_option 1 --php_extensions imagick,fileinfo,imap,ldap,redis,mongodb --pureftpd --redis
<pre class="wp-block-syntaxhighlighter-code">
[root@iZ23wv7v5ggZ ~]# wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --nginx_option 1 --php_option 11 --phpcache_option 1 --php_extensions imagick,redis --pureftpd --redis
[root@iZ23wv7v5ggZ oneinstack]# ./install.sh
#######################################################################
# OneinStack for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+ #
# For more information please visit https://oneinstack.com #
#######################################################################
Please input SSH port(Default: 22):
Do you want to install Web server? [y/n]: n
Do you want to install Database? [y/n]: n
Do you want to install PHP? [y/n]: n
Do you want to install opcode cache of the PHP? [y/n]: n
Please select PHP extensions:
0. Do not install
1. Install zendguardloader(PHP<=5.6)
2. Install ioncube
3. Install sourceguardian(PHP<=7.2)
4. Install imagick
5. Install gmagick
6. Install fileinfo
7. Install imap
8. Install ldap
9. Install phalcon(PHP>=5.5)
10. Install yaf(PHP>=7.0)
11. Install redis
12. Install memcached
13. Install memcache
14. Install mongodb
15. Install swoole
16. Install xdebug(PHP>=5.5)
Please input numbers:(Default '4 11 12' press Enter) 6
</pre>
[root@iZ23wv7v5ggZ ~]# php -v
PHP 8.1.19 (cli) (built: Jun 7 2023 11:34:24) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.19, Copyright (c) Zend Technologies
with Zend OPcache v8.1.19, Copyright (c), by Zend Technologies
[root@iZ23wv7v5ggZ ~]#
Linux 服务器运维、部署与线上故障排查
如果你的网站或后端服务部署在 Linux 服务器上,遇到访问异常、Nginx 配置问题、MySQL / Redis 异常、Docker 服务不可用、磁盘占满、CPU / 内存过高等问题,可以联系我做一次远程排查。
适合以下场景:
✅ 网站打不开或访问不稳定
✅ Nginx / PHP-FPM 配置异常
✅ MySQL / Redis 性能或连接问题
✅ Docker 服务部署与维护
✅ 服务器迁移与环境配置
✅ CPU / 内存 / 磁盘异常排查
服务内容:
✅ Linux 环境检查
✅ 网站部署与迁移
✅ Nginx / PHP-FPM / MySQL / Redis 排查
✅ Docker 配置与维护
✅ 服务器性能分析
✅ 长期远程运维支持
如需咨询,请联系我,并注明:Linux 运维咨询。
联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

发表回复