Enable some disable function for one vhost

Hello, I need certain PHP functions (exec() and shell_exec()) for a single virtual host. How can I do this properly? I tried using an FPM template, but despite phpinfo, the logs say the functions are not enabled.

Regards

Hi,

You cannot enable functions if they are globally disabled. If you enable them in the php-fpm template, they will appear as enabled, but they still won’t work.

You must do the opposite. Remove those functions from the disable_functions directive in /etc/php/X.Y/fpm/php.ini, restart the php-fpm service and then create a template for the other sites that adds the disabled functions using:

php_admin_value[disable_functions] = here,the,functions

Once done, assign that new template to your sites and rebuild them.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.