First, check to see if your PHP-FPM is running for your cPanel account.
Head to WHM > MultiPHP Manager.
If it is turned on for the account, you can edit the directive by clicking on ‘Edit PHP-FPM’.
Scroll down and ‘Edit function list’ for Disabled functions (disable functions) field.
Delete the ‘exec’ item. And Save.
That’s it!