prindop 发表于 2023-1-11 15:42:00

【待反馈】删除站点时报错(PermissionError: [WinError 5]

在windows*台下删除PHP项目网络站点出现的报错。
具体过程如下:
删除(已停止)站点

正常出现谨慎删除提示后出现

点击查看详情:

出错了,面板运行时发生错误!PermissionError: 拒绝访问。: 'c:/btsoft/apache\\bin\\httpd.exe'
>>点击查看详情

第一个框的报错内容如下:

REQUEST_DATE: 2023-01-11 14:22:04
PAN_VERSION: 7.8.0
OS_VERSION: Windows Server 2012 R2 Datacenter (build 9600) x64 (Py3.8.6)
REMOTE_ADDR: 218.18.131.69
REQUEST_URI: POST /site?action=DeleteSite
REQUEST_FORM: {'id': '3', 'webname': 'prindop.com', 'path': '1'}
USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.42




第二个框报错内容如下:
Traceback (most recent call last):
File "C:\BtSoft\panel/class\files.py", line 679, in DeleteDir
    shutil.rmtree(get.path)
File "C:\Program Files\python\lib\shutil.py", line 737, in rmtree
    return _rmtree_unsafe(path, onerror)
File "C:\Program Files\python\lib\shutil.py", line 610, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
File "C:\Program Files\python\lib\shutil.py", line 615, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
File "C:\Program Files\python\lib\shutil.py", line 613, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: 拒绝访问。: 'c:/btsoft/apache\\bin\\httpd.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\BtSoft\panel\BTPanel\__init__.py", line 1534, in publicObject
    return run_exec().run(toObject, defs, get)
File "C:\BtSoft\panel\BTPanel\__init__.py", line 1731, in run
    result = eval(fun)
File "", line 1, in
File "C:\BtSoft\panel/class\panelSite.py", line 344, in DeleteSite
    files.files().DeleteDir(get)
File "C:\BtSoft\panel/class\files.py", line 682, in DeleteDir
    shutil.rmtree(get.path)
File "C:\Program Files\python\lib\shutil.py", line 737, in rmtree
    return _rmtree_unsafe(path, onerror)
File "C:\Program Files\python\lib\shutil.py", line 610, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
File "C:\Program Files\python\lib\shutil.py", line 615, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
File "C:\Program Files\python\lib\shutil.py", line 613, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: 拒绝访问。: 'c:/btsoft/apache\\bin\\httpd.exe'


按照上面提示,修复方案一已经试过了,目前寻求修复方案二。


操作背景:
有可能是这种情况;第一次操作删除站点是非正常删除。在站点是正常运行状态下,删除硬盘中的站点文件夹 之后重装过apache。

诉求:
1、请教如何删除该站点。
2、该站点下有过备份,请问该备份能导出并在新的站点下恢复备份吗?如果可以请告知操作步骤。

谢谢!


大炮运维V587 发表于 2023-1-11 20:35:22

您好,您是安装什么安全软件了吗?提示是无权限操作

prindop 发表于 2023-2-6 17:12:34

大炮运维V587 发表于 2023-1-11 20:35
您好,您是安装什么安全软件了吗?提示是无权限操作

没有安装安全软件,会不会是跟我非正常删除有关?

大炮运维V587 发表于 2023-2-7 11:29:50

prindop 发表于 2023-2-6 17:12
没有安装安全软件,会不会是跟我非正常删除有关?
拒绝访问,这是权限的问题,要看下你当前的服务器是否安装了什么安全软件
页: [1]
查看完整版本: 【待反馈】删除站点时报错(PermissionError: [WinError 5]