How to disable/enable php_functions?
In many cases, your web application might not work as expected due to certain enabled/disabled php_functions; at that time, you need to submit the request with the server administrator or the host to disable/enable the specific php_functions. If you have cPanel or DirectAdmin control panel’s root-level access, then this article will help you with how to disable/enable php_functions?
cPanel/WHM
Using cPanel
Login to cPanel → Navigate to Software → MultiPHP INI Editor.
Navigate to Editor Mode → Select the Domain Name (Location).
Enter the PHP functions in front of “disable_functions = # # # #” to disable the PHP function → Click on Save.
Example: disable_functions = exec, system, passthru, pcntl_exec, popen, proc_open, shell_exec
To enable the disabled function, remove the specific PHP function from the disable_functions list.
Using WHM
1. First, login into the WHM panel,
https://your-domain.com:2087 or https://IP-address: 2087 or https://server-hostname: 2087.
2. Navigate to Software → MultiPHP Manager.
3. Make sure you have PHP-FPM installed and enabled for the domain names. Now, using User Domain Settings section → Search for an domain name → Click on PHP-FPM Settings.
4. Scroll down to Disable Functions, enter the PHP functions name → Click on Update.
To enable the PHP function, remove the desired PHP function from Disable Functions list.
DirectAdmin
In the DirectAdmin control panel, we have separate per user php.ini settings in php-fpm.
1. First, to login into DirectAdmin control panel visit,
https://your-domain.com:2222 or https://IP-address:2222 or https://server-hostname:2222.
2. Navigate to Server Manager → Custom HTTPD Configurations.
3. Select the domain → Click on php-fpm.conf.
4. Navigate to php-fpm 5.X/7.X/8.X |CUSTOM 2| → To alter per user domain disabled_functions add the following line following with PHP functions name which you would like to disable → Click on SAVE,
php_admin_value[disable_functions] = <function name>,<function name2>, <fuction name3>
To enable the PHP function, remove the desired PHP function from Disable Functions list.
Conclusion
Now that we’ve gone over how to disable/enable php_functions specific to the user domain. Also, we covered both the renowned control panels in the industry cPanel and DirectAdmin.
KnownHost offers 365 days a year, 24 hours a day, all 7 days of the week best in class technical support. A dedicated team ready to help you with requests should you need our assistance. You’re not using KnownHost for the best webhosting experience? Well, why not? Check with our Sales team to see what can KnownHost do for you in improving your webhosting experience.