How can php-fpm be used to override disable_functions settings in php.ini for specific scripts?

To override the disable_functions settings in php.ini for specific scripts using php-fpm, you can create a separate pool configuration file for the script and define the disable_functions setting within that file. This will allow you to enable specific functions for that script while still maintaining the global disable_functions settings for other scripts.

// Example pool configuration file (e.g., myscript.conf)
[myscript]
user = www-data
group = www-data
listen = /var/run/php/myscript.sock
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

php_admin_value[disable_functions] = "exec,passthru,shell_exec"