AWS Elasticbeanstalk modify php-fpm config file

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