Hosting Question? Find the Solution - Browse our Guides, Articles, and How-To's

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?

Modifying disable functions through the cPanel editor (user-level) only works if the server uses PHP-FPM.
For DSO/Ruid2 servers, you need to explicitly modify the php configurations directly via CLI using root access or should contact your hosting provider.


Using cPanel

Login to cPanelNavigate to SoftwareMultiPHP INI Editor.

navigate to multiphp ini editor cpanel

Navigate to Editor ModeSelect the Domain Name (Location).

navigate to editor mode and select domain name

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
disable function cpanel example

To enable the disabled function, remove the specific PHP function from the disable_functions list.

Using WHM

1. First, login into the WHM panel, or https://IP-address: 2087 or https://server-hostname: 2087.


2. Navigate to Software → MultiPHP Manager.

navigate to multi php manager in whm

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.

navigate to php-fpm settings for domain whm

4. Scroll down to Disable Functions, enter the PHP functions name Click on Update.

enter php functions whm php fpm

To enable the PHP function, remove the desired PHP function from Disable Functions list.


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, or https://IP-address:2222 or https://server-hostname:2222.


2. Navigate to Server Manager → Custom HTTPD Configurations.

navigate to directadmin custom httpd conf

3. Select the domain Click on php-fpm.conf.

click on php fpm conf directadmin

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>
how to disable_fuctions in directadmin

To enable the PHP function, remove the desired PHP function from Disable Functions list.


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.