Theme editor

How to edit disabled function at Directadmin and Cloudlinux?

Aior

Administrator
Staff member
Joined
Apr 2, 2023
Messages
84
Reaction score
2
Points
8
Age
39
Location
Turkey
Website
aior.com
Issue:
You are using DirectAdmin with CloudLinux, and the exec() function is disabled in PHP 7.3. When you check your [phpinfo()] output, you see `exec` listed under disable_functions.

You want to enable the `exec` function.


Environment:
  • Control Panel: DirectAdmin
  • OS: CloudLinux (with CageFS)
  • PHP Version: alt-php 7.3 (via PHP Selector)

Solution:

1. Connect via SSH as root:
Code:
ssh root@your-server-ip

2. Find the correct config file that sets disable_functions:
Code:
grep -r "disable_functions" /opt/alt/php73/

Look for an output like:
Code:
/opt/alt/php73/etc/php.ini:disable_functions = exec,system,passthru,shell_exec,...

3. Edit the php.ini file:
Code:
nano /opt/alt/php73/etc/php.ini

Find this line:
Code:
disable_functions = exec,system,passthru,shell_exec,...

Remove `exec` from the list:
Code:
disable_functions = system,passthru,shell_exec,...

Save and exit (`CTRL + X`, then `Y`, then `ENTER`).

4. Refresh CageFS and restart PHP:
Code:
cagefsctl --force-update
cagefsctl --remount-all
systemctl restart alt-php-fpm73

Alternative command if the one above fails:
Code:
service php-fpm73 restart

5. Verify with phpinfo():

Create a file called `phpinfo.php` in your website’s public_html folder:
PHP:
<?php phpinfo(); ?>

Open it in the browser and check the “disable_functions” section. `exec` should no longer appear there.

Notes:
- This method works only for alt-php versions managed by CloudLinux PHP Selector.
- If you're using a `.user.ini` or custom `php.ini` per user/domain, check those files as well:
Code:
find /home -name "php.ini"
find /home -name ".user.ini"
 

Featured content

Back
Top