宝塔面板错误及BUG解决方法集合(持续更新)

前言

博主目前使用的是宝塔面板7.7.0版本,旧版经常会出现一些错误和BUG
在这里统一记录下,方便以后查找处理

下载错误

在宝塔面板下载文件时出现如下错误页面

出错了,面板运行时发生错误!
TypeError: send_file() got an unexpected keyword argument 'add_etags'

image
解决方法:
在服务器SSH端运行以下命令:

/www/server/panel/pyenv/bin/pip install -U Flask==2.1.2

运行完成后重启宝塔面板服务即可;

证书错误

错误(一)
宝塔面板申请Let's Encrypt证书时报错
Invalid version. The only valid version forX509Req is 0.
image
解决方法:
找到/www/server/panel/class目录下acme_v2.py文件
查找到:X509Req.set_version(2)
修改为:X509Req.set_version(0)
修改完成后清理宝塔面板缓存再重启面板服务;

错误(二)
宝塔面板申请Let's Encrypt证书时报错
module 'OpenSSL.crypto' has no attribute 'sign'
image
解决方法:
SSH端运行以下命令,然后重启宝塔面板

btpip install pyOpenSSL==24.2.1 -U

证书续签Shell脚本

/www/server/panel/pyenv/bin/python -u /www/server/panel/class/acme_v2.py --renew=1

软件商店

如果软件商店打不开可以修改hosts连接宝塔面板的香港机房
SSH端输入以下两条命令修改hosts

sed -i "/bt.cn/d" /etc/hosts

echo "103.179.243.14 www.bt.cn download.bt.cn api.bt.cn dg1.bt.cn dg2.bt.cn" >> /etc/hosts

恢复hosts

sed -i "/bt.cn/d" /etc/hosts

规则拦截

Typecho程序在发布或编辑文章时容易被宝塔防火墙POST规则拦截
解决方法:
防火墙设置白名单URL
Nginx防火墙->全局配置->URL白名单->标准模式-URL白名单
文章编辑:

^/action/contents-post-edit?

主题设置:

^/action/themes-edit

旧版直装

直接安装宝塔7.7.0版本
安装命令:( Centos / Ubuntu / Debian )

curl -sSO https://raw.githubusercontent.com/sunpma/bt-v7.7.0/main/install/install_panel.sh && bash install_panel.sh

优化脚本

一键脚本:(注意:仅适用于宝塔面板7.7.0版本)

wget -O SunBT.sh https://suntl.com/other/bt/SunBT.sh && bash SunBT.sh

优化内容说明:

  • 去除强制绑定账号
  • 去除建站默认文件
  • 去除删除操作验证
  • 关闭版本升级通道
  • 关闭推荐客服功能
  • 解锁付费插件使用
最后修改:2025 年 04 月 07 日

发表评论 取消回复

5 条评论

  1. 我好爱

    还有现在的网站监控报表一安装一闪就没有了。站长这个能解决吗?

  2. 我好爱

    今天安装了4次,虽然安装成功,但是宝塔登陆不上,一直在转圈圈。
    在终端用BT改密码就出错了。。估计现在是安装不上旧本了。可惜了。

  3. pf

    --2025-09-15 13:42:47-- (try: 3) https://raw.githubusercontent.com/sunpma/bt-v7.7.0/main/install/src/panel6.zip
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... failed: Connection timed out.
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
    Unable to establish SSL connection.
    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    unzip: cannot find zipfile directory in one of panel.zip or

    panel.zip.zip, and cannot find panel.zip.ZIP, period.-rw-r--r-- 1 root root 576K Sep 15 13:42 panel.zip

    ERROR: Failed to download, please try install again!
    ERROR: 下载宝塔失败,请尝试重新安装!
    CentOS Linux release 7.6.1810 (Core)
    Bit:64 Mem:1756M Core:2
    Linux iZ2ze3ublp9x67y0wlhwm6Z 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    请截图以上报错信息发帖至论坛www.bt.cn/bbs求助
    [root@iZ2ze3ublp9x67y0wlhwm6Z ~]#
    安装报错

  4. zhazha

    为啥docker应用都无法安装,图标也是裂开的

  5. Huo

    这是好东西 我也用的是老版本的