宝塔安装nginx报错【已解决】

在尝试安装Nginx时遇到错误,提示需要GD库。解决方案包括安装GD和gd-devel,以及可能需要手动配置PowerTools存储库以添加正确的URL,然后使用dnf安装cmake。完成这些步骤后,可以继续安装Nginx。
摘要由CSDN通过智能技术生成

安装报错:

./configure: error: the HTTP image filter module requires the GD library. You can either do not enable the module or install the libraries.

make: *** No rule to make target 'build', needed by 'default'. Stop. make: *** No rule to make target 'install'. Stop.

/www/server/panel/install/public.sh: line 126: cmake: command not found CentOS Linux release 8.3.2011 Bit:64 Mem:1848M Core:1 gcc:8.3.1 cmake: Linux 4.18.0-240.1.1.el8_3.x86_64 x86_64 ERROR: nginx-1.22.1 installation failed.

报错原因:
requires the GD library  缺少GD库

解决方案:
1、安装GD库
sudo dnf install gd gd-devel
sudo dnf install cmake

如果报错:
Error: Failed to download metadata for repo 'PowerTools': Cannot prepare internal mirrorlist: No URLs in mirrorlist

通常是由于系统无法访问PowerTools存储库而导致的。
手动编辑存储库文件以添加正确的URL。存储库文件通常位于/etc/yum.repos.d/目录中。

具体方法:
1、备份yum.repos.d下的文件,防止操作出错无法恢复
》cd /etc
》mkdir backup
将文件递归复制到backup
》cp /etc/yum.repos.d  /etc/backup -l
编辑
》vim CentOS-PowerTools.repo
内容如下:
[PowerTools]
name=CentOS-$releasever - PowerTools
baseurl=http://mirror.centos.org/centos/$releasever/PowerTools/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

保存退出

至此,重新清空执行安装GD库
再到宝塔安装Nginx成功!!!!!!!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值