大网数据广告活动
服务器运维问答

AWS Elasticbeanstalk modify php-fpm config file

· 52CE 我爱测

My app is running on AWS Elasticbeanstalk service with PHP 7.4/AMI Linux 2 platform. And I want to modify php-fpm configuration, especially /etc/php-fpm.d/www.conf file, which manages by Beanstalk. AWS Documentation https://docs.…

问题原文

原帖链接 · aranel · CC BY-SA 4.0

My app is running on AWS Elasticbeanstalk service with PHP 7.4/AMI Linux 2 platform. And I want to modify php-fpm configuration, especially /etc/php-fpm.d/www.conf file, which manages by Beanstalk.

AWS Documentation https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html says I can modify Nginx config, but I can't find anything about php-fpm config changing. I've tried to put desired config in .platform/php-fpm.d/www.conf and tried to overwrite www.conf by using ebextensions, but unsuccessfully. Did anybody do this?

社区高分解答

原帖链接 · Michael Malura · CC BY-SA 4.0

Create a script inside .platform/hooks/predeploy. The script should create a new config file inside /etc/php-fpm.d/.

Our script for example looks like this.

#!/usr/bin/env bash

# the script starts with z so it is getting loaded after the www.conf
cat <<EOT > /etc/php-fpm.d/z-99-custom.conf
[www]
pm.max_children = 4
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 2
pm.max_requests = 10
EOT

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-04-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。