check-docker-php-config
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "check-docker-php-config":https://skillpi.com/zh/skills/deepskill-277eddc3b82b486ab848422b3188b1cbd24480720c5e69fa7970e170bf9d35dc。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
检查 Docker 容器中的 PHP 配置。验证 php.ini 设置、OPcache 配置、PHP-FPM 池配置以及用于生产环境的扩展配置是否正确。
介绍来源: third_party · dykyi-roman · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 减记
- 实测状态
- 未测试
文件浏览
Frontmatter
name: check-docker-php-config
description: Checks PHP configuration in Docker containers. Verifies php.ini settings, OPcache, PHP-FPM pool, and extension configuration for production.Docker PHP Configuration Checker
Analyze PHP configuration within Docker environments for production readiness.
Configuration Checks
1. php.ini Production vs Development
# BAD: Development config
RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
# GOOD: Production config
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
2. OPcache Configuration
; GOOD: OPcache optimized for production
opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0
opcache.save_comments=1
3. OPcache JIT (PHP 8.4+)
opcache.jit=1255
opcache.jit_buffer_size=128M
4. PHP-FPM Pool Configuration
; BAD: Static pm wastes memory; ondemand has fork overhead
pm = static
pm.max_children = 100
; GOOD: Dynamic pm with tuned values
pm = dynamic
pm.max_children = 50
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 1000
5. Memory Limit
; BAD: Unlimited memory
memory_limit = -1
; GOOD: Appropriate for workload
memory_limit = 128M ; web
memory_limit = 256M ; workers
memory_limit = 512M ; batch
6. Error Reporting
; BAD: Development error display
display_errors = On
; GOOD: Production settings
display_errors = Off
display_startup_errors = Off
log_errors = On
error_log = /proc/self/fd/2
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
7. Session Handling
; BAD: File-based sessions (not scalable)
session.save_handler = files
; GOOD: External storage
session.save_handler = redis
session.save_path = "tcp://redis:6379"
8. Upload Limits
upload_max_filesize = 20M
post_max_size = 25M
max_file_uploads = 10
9. Timezone
date.timezone = UTC
10. Realpath Cache
; GOOD: Increased for Symfony/Laravel
realpath_cache_size = 4096K
realpath_cache_ttl = 600
Grep Patterns
Grep: "php.ini-(production|development)" --glob "**/Dockerfile*"
Grep: "opcache\\." --glob "**/{Dockerfile*,*.ini,*.conf}"
Grep: "^pm[. =]" --glob "**/*.conf"
Grep: "memory_limit" --glob "**/{Dockerfile*,*.ini,*.conf}"
Grep: "display_errors" --glob "**/{Dockerfile*,*.ini,*.conf}"
Grep: "session\\.save_handler" --glob "**/{Dockerfile*,*.ini,*.conf}"
Grep: "upload_max_filesize|post_max_size" --glob "**/{Dockerfile*,*.ini,*.conf}"
Grep: "date\\.timezone" --glob "**/{Dockerfile*,*.ini,*.conf}"
Grep: "realpath_cache" --glob "**/{Dockerfile*,*.ini,*.conf}"
Grep: "opcache\\.jit" --glob "**/{Dockerfile*,*.ini,*.conf}"
Detection Sources
- Dockerfile RUN echo — inline php.ini directives
- COPY'd php.ini — full configuration replacement
- *COPY'd conf.d/.ini** — modular config files
- PHP-FPM pool config — www.conf or custom pools
- Environment variables — PHP_INI_SCAN_DIR overrides
Severity Classification
| Check | Severity | Impact |
|---|---|---|
| Using php.ini-development | Critical | Exposes errors, no OPcache |
| OPcache disabled | Critical | 3-10x slower responses |
| display_errors = On | Critical | Information disclosure |
| memory_limit = -1 | Major | OOM risk |
| validate_timestamps=1 | Major | FS checks per request |
| File-based sessions | Major | Not scalable, data loss |
| No timezone set | Minor | Inconsistent dates |
| Default upload limits | Minor | May block uploads |
| No realpath cache tuning | Minor | Extra FS lookups |
| JIT not configured | Minor | Missing perf gains |
Output Format
### PHP Config Issue: [Description]
**Severity:** Critical/Major/Minor
**Setting:** `directive = value`
**Location:** `Dockerfile:line` or `config-file:line`
**Current Value:**
```ini
directive = current_value
Recommended Value:
directive = recommended_value
Rationale: [Why this setting matters for production]
当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 针对生产环境 Docker PHP 配置检查的明确痛点
- 提供 BAD/GOOD 对比示例,实用性强
- 覆盖 php.ini、OPcache、PHP-FPM 等关键配置项
亮点
- 触发描述完整覆盖核心功能点
- 边界清晰,无歧义
待提升项
-
缺少 When to Use 章节 原报告严重程度:轻微
文档结构完整但缺少明确的使用场景说明章节
改进建议:建议补充 When to Use 章节,说明适用场景和使用时机
亮点
- 结构清晰,章节划分合理
- 提供具体配置示例和 severity 分类
- 输出格式标准化
亮点
- 配置建议具体且有生产环境依据
- 提供 grep 模式用于实际检测
- 覆盖主要异常场景和错误配置
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。