Files
AIclinicalresearch/redcap-docker-dev/config/php/php.ini
HaHafeng 38d9bf99d6 feat(redcap): REDCap 15.8.0 Docker本地开发环境部署完成
核心成果:
- REDCap 15.8.0成功部署在Docker环境
- 登录功能正常,管理员账户: Admin/Admin123!
- MySQL 8.0 + PHP 8.1 + Apache 2.4环境验证通过

问题解决:
1. 修复ERR_CONTENT_DECODING_FAILED错误
   - 强制禁用Apache deflate模块
   - PHP配置关闭zlib.output_compression
   - 自动注释REDCap源码中的压缩设置

2. 修复Base URL配置错误
   - 更新redcap_config表中的redcap_base_url
   - 统一DocumentRoot与访问路径

3. 修复登录失败问题(CRLF污染)
   - 删除database.php末尾的PHP结束标签
   - 创建.gitattributes规范换行符
   - 验证REDCap官方源码无此问题

技术改进:
- 添加密码重置工具脚本
- 完善docker-entrypoint.sh启动脚本
- 创建详细的部署问题解决记录
- 建立PHP配置文件最佳实践

部署文档:
- REDCap本地Docker开发环境部署方案
- REDCap生产环境部署决策报告(ECS vs SAE)
- 部署问题解决记录(含根因分析)

下一步:
- Day 2: 开发REDCap API Adapter
- 实现与IIT Manager Agent的数据对接
2026-01-02 10:02:46 +08:00

138 lines
3.8 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
; REDCap PHP配置文件
; 版本v1.0
; 日期2026-01-01
; 适用:开发/测试/生产环境
; ========== 文件上传配置REDCap必需 ==========
; REDCap允许上传临床试验文件、影像资料等
upload_max_filesize = 32M
post_max_size = 32M
max_file_uploads = 20
; ========== 执行时间配置 ==========
; 数据导出和复杂查询需要更长时间
max_execution_time = 300
max_input_time = 300
default_socket_timeout = 60
; ========== 内存限制 ==========
; REDCap推荐最低256MB
memory_limit = 256M
; ========== 时区配置 ==========
; 非常重要!影响数据时间戳
date.timezone = Asia/Shanghai
; ========== 错误报告(开发环境) ==========
; 开发环境:显示所有错误
; 临时关闭 display_errors 避免干扰压缩输出流ERR_CONTENT_DECODING_FAILED
display_errors = Off
display_startup_errors = Off
error_reporting = E_ALL
; 生产环境应修改为:
; display_errors = Off
; display_startup_errors = Off
; error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
; log_errors = On
; error_log = /var/log/php/error.log
; ========== Session配置 ==========
; REDCap使用Session管理用户登录状态
session.save_handler = files
session.save_path = "/tmp"
session.gc_maxlifetime = 3600
session.cookie_lifetime = 0
session.cookie_httponly = 1
session.cookie_secure = 0 ; 生产环境HTTPS启用时改为1
session.use_strict_mode = 1
session.use_cookies = 1
session.use_only_cookies = 1
; ========== 安全配置 ==========
; 禁止危险函数(生产环境推荐)
; disable_functions = exec,passthru,shell_exec,system,proc_open,popen
; 允许URL文件访问REDCap的Web Service功能需要
allow_url_fopen = On
; 禁止URL文件包含安全
allow_url_include = Off
; 隐藏PHP版本信息安全
expose_php = Off
; ========== 数据库配置 ==========
; MySQL连接超时
mysqli.default_socket =
mysqli.connect_timeout = 60
mysqli.reconnect = On
; ========== OPcache配置性能优化 ==========
; 生产环境强烈推荐启用OPcache
opcache.enable = 1
opcache.enable_cli = 0
opcache.memory_consumption = 128
opcache.interned_strings_buffer = 8
opcache.max_accelerated_files = 10000
opcache.revalidate_freq = 2
opcache.fast_shutdown = 1
; 开发环境可能需要禁用缓存验证
; opcache.validate_timestamps = 0
; ========== 字符编码 ==========
; 确保UTF-8编码支持中文
default_charset = "UTF-8"
mbstring.language = UTF-8
mbstring.internal_encoding = UTF-8
; ========== 邮件配置 ==========
; SMTP配置REDCap调查邀请等功能需要
; 通常在REDCap控制中心配置这里可留空
SMTP = localhost
smtp_port = 25
sendmail_from = noreply@localhost
; ========== 输出缓冲 ==========
; REDCap数据导出需要
; 临时禁用输出缓冲,解决 ERR_CONTENT_DECODING_FAILED
output_buffering = Off
; ========== 禁用 zlib 压缩(解决 ERR_CONTENT_DECODING_FAILED==========
; REDCap 内部会控制输出压缩,必须禁用 PHP 层面的压缩避免冲突
zlib.output_compression = Off
zlib.output_compression_level = -1
zlib.output_handler =
; ========== 其他配置 ==========
; 最大输入变量数(复杂表单需要)
max_input_vars = 3000
; 最大输入嵌套层级
max_input_nesting_level = 64
; 日志配置
log_errors = On
log_errors_max_len = 1024
; ========== 扩展配置 ==========
; 确保以下扩展已启用在Dockerfile中已安装
; extension=mysqli
; extension=pdo_mysql
; extension=gd
; extension=zip
; extension=soap
; extension=ldap
; extension=mbstring
; extension=calendar
; extension=bcmath
; ========== 注释说明 ==========
; 1. 此配置适用于REDCap 15.8.0
; 2. 生产环境应关闭display_errors
; 3. 生产环境应启用OPcache
; 4. 文件上传大小可根据需求调整
; 5. 时区配置必须正确,影响数据时间戳