How to Disable PHP Functions from WHM Panel
To disable PHP functions from the WHM panel, you need to use the MultiPHP INI Editor. This tool allows you to modify the PHP configuration for individual cPanel users or globally for all accounts on the server. Disabling functions is a common security practice to prevent malicious scripts from executing potentially dangerous commands.
Step 1: Log in to WHM and Access MultiPHP INI Editor
First, log in to your WebHost Manager (WHM) as the root user. In the WHM search bar on the left, type “MultiPHP INI Editor” and click on the corresponding option under the Software section.
Step 2: Select the PHP Version and Location
On the MultiPHP INI Editor page, you’ll have two options:
- Basic Mode: This allows you to select a specific user and their PHP version to edit.
- Editor Mode: This allows you to edit the global PHP configuration (
php.ini
). For disabling functions across the entire server, this is the most effective method.
For a server-wide change, select Editor Mode. From the dropdown menu, choose the PHP version you want to modify (e.g., ea-php74
).
Step 3: Disable Functions in php.ini
In the text box, scroll down and find the disable_functions
directive. This line is where you list all the PHP functions you want to disable, separated by commas.
For example, to disable exec
, shell_exec
, passthru
, and system
functions, your line should look like this:
disable_functions = exec, shell_exec, passthru, system
You can add any other functions to this list. Some commonly disabled functions for security reasons include: proc_open
, proc_close
, popen
, pclose
, dl
.
Step 4: Save the Changes
After you have added the functions to the list, scroll to the bottom of the page and click the Save button. WHM will automatically apply the changes to the php.ini
file for the selected PHP version. The changes will take effect immediately.