📝 How to Configure disable_functions in cPanel
To enhance your website’s security, it may be necessary to disable certain PHP functions in the configuration.This process can be easily done through cPanel. In this guide, we’ll walk you step-by-step through how to edit the
disable_functions setting using the cPanel/WHM panel.🔒 What Is disable_functions?
disable_functions is a directive in the PHP configuration file (php.ini). It allows you to disable specific PHP functions that could pose security risks.
For example, functions such as
exec, shell_exec, and passthru can be used to execute system commands, which makes them potential targets for malicious activity.🔧 Step-by-Step: Configuring disable_functions in WHM Panel
- Log in to WHM Panel
- Go to “MultiPHP INI Editor”
Use the search bar on the left menu and type MultiPHP INI Editor to open the relevant page. - Select the “Editor Mode” Tab
From here, choose the PHP version you want to edit (e.g., PHP 8.2). - Find the disable_functions Line
You should see a line similar to the example below:
Bash:
disable_functions = "exec,passthru,shell_exec,system,proc_open,popen"
You can update this line based on your security needs.
For example, to disable only the
exec and system functions, use:
Bash:
disable_functions = "exec,system"
⚠️ Important Notes
- Be cautious when disabling functions, as some PHP applications and plugins may rely on them to function properly.
Only disable functions you’re certain are not required by your system. - To verify that your changes are working, you can create a simple PHP file that displays current configuration values using
phpinfo().