报“the process timed out”错误应调process-timeout(控制git clone、unzip等子进程超时,默认300秒),而非http.timeout;若卡在downloading https://则需同步调整http-basic-timeout和http.timeout,并检查php default_socket_timeout是否匹配。

直接改 process-timeout 和 http-basic-timeout 两个配置项,不是只调一个——漏掉任一个都可能继续超时。
报 The process timed out 错误该调哪个参数
这是子进程执行超时,比如 git clone、unzip、跑 post-install-cmd 脚本卡住。错误里一定含 [RuntimeException] The process "" exceeded the timeout。
-
process-timeout控制单个外部命令最大执行时间,默认 300 秒(5 分钟),和 HTTP 下载完全无关 - 全局改:运行
composer config -g process-timeout 1800,写入~/.composer/config.json - 项目级改:在
composer.json顶层加"config": {"process-timeout": 1200} - 临时覆盖优先级最高:
COMPOSER_PROCESS_TIMEOUT=2400 composer install(注意环境变量名是COMPOSER_PROCESS_TIMEOUT,不是COMPOSER_HTTP_TIMEOUT)
卡在 Downloading https:// 时该调哪个参数
这是 HTTP 请求阶段卡住,比如拉 packages.json、下载 ZIP 包,错误里常带 cURL error 28 或反复 retry 后失败。
围绕关键发现、作用机制、临床相关性及研究局限性展开讨论。适用于撰写或优化任何生物医学论文的“讨论(Discussion)”部分——包括结果解读、与既往文献关联、阐释意外发现、界定研究局限性,以及撰写结论。当用户输入以下任一指令时也会自动触发该功能: - “write my discussion” - “help me discuss my findings” - “how do I compare to prior studies” - “write the limitations par
-
http-basic-timeout控制单次 HTTP 连接 + 读取时限,默认仅 60 秒(Composer 2.2+ 才支持) -
http.timeout是更底层的总时限(DNS 解析 + TLS 握手 + 首字节等待 + 整个 body 传输),默认 300 秒,影响所有 HTTP 操作 - 项目级最稳:
composer config http-basic-timeout 300+composer config http.timeout 600 - 别忘了同步检查 PHP 的
default_socket_timeout:运行php -i | grep default_socket_timeout,若低于你设的http.timeout,连接会被 PHP 提前掐断(常见值是 60)
为什么改了还超时?常见被忽略的点
单纯延长超时只是“等得更久”,不解决根本瓶颈。以下情况即使 timeout 设为 0 也会卡死:
- 国内直连
packagist.org不稳定,必须换镜像源:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ - 项目里硬编码了
repositories,会覆盖全局镜像配置,需手动清理或显式设为镜像地址 - 私有 Git 仓库(如
git@xxx或https://gitlab.example.com/xxx)不走镜像,要单独优化 SSH 配置或启用 HTTPS 认证缓存 -
use-include-path设为true可能触发慢速 autoload 扫描,建议关掉:composer config -g use-include-path false
真正卡住的时候,往往不是 timeout 数值不够大,而是某一层没对齐——比如 PHP 的 default_socket_timeout 比 Composer 的 http.timeout 小,或者镜像配置被 composer.json 里的 repositories 覆盖了,这些细节比调数字更容易被跳过。










