当前位置:首页>python>PyInstaller 指南:Python 打包为 EXE 的系统教程与最佳实践

PyInstaller 指南:Python 打包为 EXE 的系统教程与最佳实践

  • 2026-02-28 01:15:02
PyInstaller 指南:Python 打包为 EXE 的系统教程与最佳实践

PyInstaller 指南:Python 打包为 EXE 的系统教程与最佳实践

罗光宣

PyInstaller 是 Python 生态中最流行、最易用的打包工具之一,它能够将 Python 脚本及其所有依赖项打包成独立的可执行文件,让没有 Python 环境的用户也能轻松运行你的程序。本文将系统介绍 PyInstaller 的完整使用方法,从基础入门到高级配置,助你掌握打包技能。

一、PyInstaller 简介与工作原理

PyInstaller 是一个跨平台的 Python 应用打包工具,支持 Windows、Linux、macOS 等主流操作系统。它的核心优势在于能够自动分析 Python 代码的依赖关系,将 Python 解释器、标准库、第三方库以及你的脚本代码打包成一个独立的可执行文件。

打包原理

1.依赖分析:扫描脚本的 import 语句,递归查找所有依赖库

2.字节码转换:将 .py 文件编译为 .pyc 字节码

3.打包嵌入:将 Python 解释器、标准库、第三方库和脚本打包到单一目录/文件

4.启动器生成:创建平台相关的启动程序(如 Windows 的 .exe)

单文件与目录模式单文件模式(-F) 运行时会把内嵌内容解压到系统临时目录,该路径在运行期通过 sys._MEIPASS 暴露,因此首次启动会略慢,资源路径需基于 _MEIPASS 获取。目录模式(-D) 直接从 dist/程序名/ 目录加载,无需解压,启动更快,资源文件就在该目录下。

主要优点

·跨平台支持:可在不同操作系统上打包对应平台的可执行文件

·自动依赖检测:支持主流第三方库(如 PyQt、Django、pandas 等)

·简单易用:大部分情况下只需一行命令即可完成打包

·分发方便:用户无需安装 Python 环境即可运行程序

二、安装 PyInstaller

基础安装

pip install pyinstaller

升级到最新版本

pip install --upgrade pyinstaller

使用国内镜像加速安装

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyinstaller

验证安装

pyinstaller --version

安装注意事项

1.建议在虚拟环境中安装,避免包依赖冲突

2.若遇到权限问题,可使用 pip install --user pyinstaller 安装到用户目录

3.确保 Python 的 Scripts 目录已加入系统环境变量 PATH

三、基础打包:从 Hello World 开始

创建测试脚本

创建一个简单的 Python 脚本 hello.py

print("Hello, 我是被PyInstaller打包的EXE!")input("按回车键退出...")

最简单的打包命令

pyinstaller hello.py

执行后会在当前目录生成两个文件夹:

·build/:存放临时文件,可忽略

·dist/:包含打包结果,其中 dist/hello/ 目录下有可执行文件 hello.exe

单文件打包模式

pyinstaller --onefile hello.py# 或简写为pyinstaller -F hello.py

单文件模式将所有依赖打包成一个独立的 .exe 文件,分发更加方便。

四、常用命令行参数详解

PyInstaller 提供了丰富的参数来控制打包过程,以下是核心参数汇总:

参数

简写

说明

示例

--onefile

-F

打包成单个可执行文件

pyinstaller -F app.py

--onedir

-D

打包成目录(默认)

pyinstaller -D app.py

--windowed

-w

不显示控制台窗口(GUI程序)

pyinstaller -w gui.py

--console

-c

显示控制台窗口(默认)

pyinstaller -c app.py

--icon=FILE

-i

设置可执行文件图标

pyinstaller -i icon.ico app.py

--name=NAME

-n

指定输出文件名

pyinstaller -n MyApp app.py

--add-data SRC;DST

添加非Python文件

pyinstaller --add-data "data.json;." app.py

--hidden-import MOD

强制包含未自动检测的模块

pyinstaller --hidden-import pandas app.py

--exclude-module MOD

排除不需要的模块

pyinstaller --exclude-module matplotlib app.py

--clean

清理临时文件

pyinstaller --clean app.py

--debug

启用调试模式

pyinstaller --debug app.py

--upx-dir=PATH

指定UPX压缩工具目录

pyinstaller --upx-dir=C:\upx app.py

实用组合示例

# 打包成单文件GUI程序并设置图标 pyinstaller -F -w --icon=app.ico --name="MyApp" main.py # 包含配置文件和图片资源 pyinstaller -F --add-data "config.ini;." --add-data "images/*.png;images" app.py # 处理隐藏导入和排除模块 pyinstaller -F --hidden-import=pandas --exclude-module=matplotlib main.py

路径分隔符注意

·Windows:使用分号 ; 分隔源路径和目标路径

·Linux/macOS:使用冒号 : 分隔

·路径含空格时,请将 SRC;DST 整体用引号包裹,如 --add-data "my data/config.json;."

·在 .spec 文件的 datas 中使用元组 (源, 目标) 即可,PyInstaller 会按当前平台处理,同一份 spec 可跨平台使用

五、处理复杂项目:资源文件与依赖项

1. 添加资源文件

当代码中引用了图片、音频、配置文件等外部文件时,需要使用 --add-data 参数手动打包:

pyinstaller --add-data "images/*.png;images" --add-data "config.ini;." app.py

2. 代码中动态获取资源路径

单文件打包后,PyInstaller 会把数据文件解压到临时目录,该目录路径在运行期通过 sys._MEIPASS 暴露;开发时没有 _MEIPASS,因此用脚本所在目录作为资源根目录,这样无论从哪个目录启动脚本都能找到资源。示例:

import sysimport osdef resource_path(relative_path):"""获取资源的绝对路径,支持开发环境和 PyInstaller 打包后"""ifhasattr(sys, '_MEIPASS'):# 打包后:单文件解压到的临时目录base_path = sys._MEIPASSelse:# 开发环境:以脚本所在目录为基准,避免从其他目录启动时找不到资源base_path = os.path.dirname(os.path.abspath(__file__))return os.path.join(base_path, relative_path)# 使用示例config_path = resource_path('config.json')image_path = resource_path('images/logo.png')

3. 强制引入隐藏依赖

某些库(如动态导入的模块)可能未被自动检测,需通过 --hidden-import 声明:

pyinstaller --hidden-import=pandas --hidden-import=sklearn model.py

六、高级配置:使用 .spec 文件定制化打包

对于复杂项目或需要重复打包的场景,使用 .spec 文件可以提供更精细的控制。

生成 .spec 文件

pyi-makespec --onefile app.py# 或通过打包命令自动生成pyinstaller --onefile app.py

编辑 .spec 文件示例

datas 使用 (源路径, 目标路径) 元组即可,PyInstaller 会按当前平台处理路径,同一份 spec 可在 Windows/Linux/macOS 共用。

# -*- mode: python ; coding: utf-8 -*-block_cipher =None= Analysis(['app.py'],# 主程序文件pathex=[],# 额外搜索路径binaries=[],# 二进制文件datas=[# 数据文件(元组格式,跨平台)('config.json''.'),('images/*.png''images'),('data/*.db''data')],hiddenimports=[# 隐藏导入的模块'pandas._libs.tslibs.np_datetime',              'sklearn.utils._weight_vector'],hookspath=[],# 自定义hook路径hooksconfig={}, # hooks配置runtime_hooks=[], # 运行时hookexcludes=[],# 排除模块win_no_prefer_redirects=False,              win_private_assemblies=False,              cipher=block_cipher,noarchive=False,              )# 单文件配置pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)exe = EXE(pyz,a.scripts,a.binaries,a.zipfiles,a.datas,[],name='MyApplication',# 程序名debug=False,              bootloader_ignore_signals=False,              strip=False,              upx=True,# 使用UPX压缩upx_exclude=[],runtime_tmpdir=None,              console=False,# 不显示控制台icon='myicon.ico',# 图标disable_windowed_traceback=False,              argv_emulation=False,              target_arch=None,              codesign_identity=None,              entitlements_file=None,              )

使用 .spec 文件重新打包

pyinstaller app.spec

七、体积优化:让 EXE 文件更小巧

默认打包的 EXE 文件可能较大,以下方法可有效减小体积:

1. 使用 UPX 压缩

UPX 可减少 30%-50% 体积:

# 先下载 UPX 工具并配置环境变量pyinstaller --onefile --upx-dir=C:\upx app.py

2. 剔除无用库

pyinstaller --exclude-module=matplotlib --exclude-module=scipy app.py

3. 启用虚拟环境

在纯净的虚拟环境中打包,避免引入冗余依赖:

# 创建虚拟环境python -m venv packaging_env# 激活虚拟环境(Windows)packaging_env\Scripts\activate# 只安装必要依赖pip install pyinstaller pandas numpy# 进行打包pyinstaller -F app.py

4. 只导入需要的模块

只导入实际用到的模块或子模块,避免 import * 或导入整包却只用其中一小部分;对体积敏感时可配合 --exclude-module 排除确认不需要的库。注意:PyInstaller 会递归分析 import,import x 与 from x import y 都会把模块 x 纳入打包,不能靠“改用 from”来减体积。

八、调试与测试:解决打包后闪退问题

1. 保留控制台查看报错

打包时不要使用-w 或 --noconsole,保留控制台窗口,运行 EXE 时即可在控制台看到报错信息。

2. 添加全局异常捕获

import sysimport tracebackimport loggingdef setup_exception_logging():"""设置全局异常捕获"""def exception_handler(exc_type, exc_value, exc_traceback):logging.error("未捕获的异常", exc_info=(exc_type, exc_value, exc_traceback))sys.excepthook = exception_handlerif__name__=="__main__":setup_exception_logging()# 你的主程序代码

3. 常见错误排查

·ModuleNotFoundError:使用 --hidden-import 添加缺失模块

·FileNotFoundError:检查资源文件路径,使用 --add-data 添加;代码中用 resource_path() 获取路径

·DLL 缺失:使用 --add-binary 添加依赖库,例如:pyinstaller --add-binary "path/to/mydll.dll;." app.py(Windows 用 ;,Linux/macOS 用 :

·权限错误:以管理员身份运行或检查防病毒软件

九、常见问题一站式解决

1. EXE 文件被杀毒软件误报

原因:PyInstaller 生成的启动器可能被误判为病毒              解决方案

·向杀软添加信任

·购买代码签名证书进行数字签名

·使用其他打包工具(如 cx_Freeze)尝试

2. 打包后启动速度慢

原因:单文件模式需解压临时文件              优化方案

·改用目录模式(-D

·使用 UPX 压缩

·减少不必要的依赖

3. 依赖库版本冲突

解决方案

·在 requirements.txt 中固定版本号

·确保打包环境与开发环境一致

·使用虚拟环境隔离

4. 中文显示乱码(GUI 程序)

解决方案

# PyQt 示例(字体随平台选择)from PyQt5.QtGui import QFont# Windows 常用 SimHei;Linux 可选用 WenQuanYi Micro Hei 等font = QFont("SimHei")app.setFont(font)

跨平台时可先检测系统再选字体,或使用字体回退。

5. 递归深度超限

import syssys.setrecursionlimit(5000)# 调整为更大值

十、最佳实践总结

1.环境准备:始终在虚拟环境中进行打包,确保环境干净

2.测试先行:打包前在当前环境用 python main.py(或你的入口)完整跑通功能,再执行 PyInstaller

3.Python 版本:打包所用 Python 版本建议与目标运行环境一致或兼容(如均为 3.8),避免 C 扩展等因 ABI 不兼容在目标机无法加载

4.参数选择

o开发测试阶段:使用目录模式(-D),便于调试

o最终发布:使用单文件模式(-F),方便分发

5.资源管理:使用 resource_path() 函数处理资源文件路径(开发时以脚本所在目录为基准)

6.依赖控制:通过 requirements.txt 固定依赖版本

7.体积优化:使用 UPX 压缩,用 --exclude-module 排除不必要的模块

8.跨平台注意:PyInstaller 生成的可执行文件是平台相关的,需要在目标平台上打包

9.安全考虑:PyInstaller 打包进去的 .pyc 可被反编译工具还原为近似源码;若含敏感逻辑或密钥,应配合代码混淆、或把敏感部分放到服务端;对外分发可考虑代码签名证书

十一、完整打包示例

项目结构

my_project/├── main.py├── config.json├── app.ico├── images/└── logo.png└── data/└── database.db

打包命令

以下为多行书写示例;Windows CMD 中反斜杠 \ 不表示续行,请改为一行输入或用 ^ 续行。

# Linux/macOS 可这样写(\ 续行)pyinstaller --onefile --windowed --icon=app.ico --name="MyApplication" \--add-data="config.json;." --add-data="images/logo.png;images" \--add-data="data/database.db;data" --hidden-import=pandas \--exclude-module=matplotlib --upx-dir=C:\upx main.py

Windows 下一行写法(路径分隔符用 ;):

pyinstaller --onefile --windowed --icon=app.ico --name="MyApplication" --add-data="config.json;." --add-data="images/logo.png;images" --add-data="data/database.db;data" --hidden-import=pandas --exclude-module=matplotlib --upx-dir=C:\upx main.py

代码中的资源路径处理

import sysimport osimport jsondef resource_path(relative_path):"""获取打包后资源的绝对路径(开发时以脚本所在目录为基准)"""ifhasattr(sys, '_MEIPASS'):base_path = sys._MEIPASSelse:base_path = os.path.dirname(os.path.abspath(__file__))return os.path.join(base_path, relative_path)# 主程序if__name__=="__main__":# 读取配置文件config_path = resource_path('config.json')withopen(config_path, 'r', encoding='utf-8'as f:config = json.load(f)# 加载图片logo_path = resource_path('images/logo.png')print(f"应用名称: {config['app_name']}")print(f"Logo路径: {logo_path}")

结语

PyInstaller 是 Python 开发者必备的打包工具,掌握其使用方法能极大提升程序的分发效率。通过本文的系统介绍,你应该已经掌握了从基础打包到高级配置的完整技能。打包是实践性很强的过程,遇问题可多查阅官方文档和社区讨论,结合本文的解决方案即可逐步排错。

发布前检查:① 本地用 python main.py 完整跑通;② 确认所有依赖和资源文件均已正确包含;③ 在目标环境(或与目标一致的系统)上试运行一次,再对外分发。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-28 12:39:48 HTTP/2.0 GET : https://f.mffb.com.cn/a/477399.html
  2. 运行时间 : 0.241060s [ 吞吐率:4.15req/s ] 内存消耗:5,193.49kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=8d24fd41d70fc56e37cae6093d98fd56
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001026s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001283s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000620s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.015696s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001265s ]
  6. SELECT * FROM `set` [ RunTime:0.000586s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001383s ]
  8. SELECT * FROM `article` WHERE `id` = 477399 LIMIT 1 [ RunTime:0.004916s ]
  9. UPDATE `article` SET `lasttime` = 1772253588 WHERE `id` = 477399 [ RunTime:0.021069s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.001630s ]
  11. SELECT * FROM `article` WHERE `id` < 477399 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.004692s ]
  12. SELECT * FROM `article` WHERE `id` > 477399 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000981s ]
  13. SELECT * FROM `article` WHERE `id` < 477399 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.008907s ]
  14. SELECT * FROM `article` WHERE `id` < 477399 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.008453s ]
  15. SELECT * FROM `article` WHERE `id` < 477399 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.007372s ]
0.244673s