如何在MAMP Pro中延长FastCGI空闲超时时间?
解决MAMP CGI模式下FastCGI超时问题
当MAMP以CGI模式运行,页面加载超30秒出现FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php7.4.12.fcgi" aborted: idle timeout (30 sec)错误时,可按以下步骤延长超时时间:
1. 修改Apache的FastCGI超时配置
- 打开MAMP,点击顶部菜单栏的
MAMP→Preferences→Apache,点击Open Conf File打开httpd.conf配置文件。 - 在文件中找到对应PHP版本的
FastCgiServer配置行,在末尾添加-idle-timeout [自定义秒数],比如设置为60秒:FastCgiServer "/Applications/MAMP/fcgi-bin/php7.4.12.fcgi" -idle-timeout 60 - 若未找到
FastCgiServer行,确保FastCGI模块已启用后手动添加上述配置。
2. 调整PHP执行超时(可选但建议)
- 点击
MAMP→Preferences→PHP,选择对应PHP版本后点击Open php.ini。 - 修改
max_execution_time参数为匹配的超时秒数:max_execution_time = 60
3. 重启MAMP服务
- 返回MAMP主界面,先点击
Stop Servers,再点击Start Servers使配置生效。
内容的提问来源于stack exchange,提问作者Steve Moretz
相关产品推荐
相关产品推荐

