# How can I enable shell\_exec?

**URL:** <https://forum.hestiacp.com/t/how-can-i-enable-shell-exec/11955>\
**Category:** Community Support\
**Created:** [November 18, 2023, 1:36pm UTC](https://forum.hestiacp.com/t/how-can-i-enable-shell-exec/11955 "2023-11-18T13:36:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stc2020](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/s/7cd45c/32.png) [@stc2020](https://forum.hestiacp.com/u/stc2020)\
**Post date:** [November 18, 2023, 1:36pm UTC](https://forum.hestiacp.com/t/how-can-i-enable-shell-exec/11955/1 "2023-11-18T13:36:26Z")

</div>

Hello. Please, friends and experienced people, help me solve this problem that is exhausting me. How can I enable shell\_exec?

```auto
shell_exec() has been disabled for security reasons, please contact your host provider to enable it.
shell_exec is required to enable this system.

```

---

<div class="post-metadata">

**Author:** ![sahsanu](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/sahsanu/32/9318_2.png) [@sahsanu](https://forum.hestiacp.com/u/sahsanu)\
**Post date:** [November 18, 2023, 1:46pm UTC](https://forum.hestiacp.com/t/how-can-i-enable-shell-exec/11955/2 "2023-11-18T13:46:50Z")

</div>

Hi,

Keep in mind that **enabling shell\_exec could be a security risk**.

Edit the `php.ini` file for your php version and mode (cli and/or fpm) and remove `shell_exec` from `disable_functions` directive.

Example for php 8.2 version:

CLI: `/etc/php/8.2/cli/php.ini`

FPM: `/etc/php/8.2/fpm/php.ini`

Before removing shell\_exec:

```auto
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pc
ntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtim
edwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen

```

After:

```auto
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pc
ntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtim
edwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,proc_open,popen

```

After that, restart php service.

`systemctl restart php8.2-fpm`

---

<div class="post-metadata">

**Author:** ![stc2020](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/s/7cd45c/32.png) [@stc2020](https://forum.hestiacp.com/u/stc2020)\
**Post date:** [November 18, 2023, 2:22pm UTC](https://forum.hestiacp.com/t/how-can-i-enable-shell-exec/11955/3 "2023-11-18T14:22:15Z")

</div>

Thank you for the quick response. Please, where is the option or place in hestiacp to modify it?

---

<div class="post-metadata">

**Author:** ![sahsanu](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/sahsanu/32/9318_2.png) [@sahsanu](https://forum.hestiacp.com/u/sahsanu)\
**Post date:** [November 18, 2023, 2:28pm UTC](https://forum.hestiacp.com/t/how-can-i-enable-shell-exec/11955/4 "2023-11-18T14:28:04Z")

</div>

Server settings → Edit the php service (use the pencil icon shown when hovering the service name) → Advanced options (here you can modify php.ini file) and once done → Save

---

<div class="post-metadata">

**Author:** ![stc2020](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/s/7cd45c/32.png) [@stc2020](https://forum.hestiacp.com/u/stc2020)\
**Post date:** [November 18, 2023, 3:08pm UTC](https://forum.hestiacp.com/t/how-can-i-enable-shell-exec/11955/5 "2023-11-18T15:08:17Z")

</div>

The problem was solved successfully. Thank you, my friend, for helping me.

---

<div class="post-metadata">

**Author:** ![system](https://forum.hestiacp.com/uploads/default/original/1X/d9a5b68bf50ced83e880b56452e592b204761b19.png) [@system](https://forum.hestiacp.com/u/system)\
**Post date:** [December 18, 2023, 3:08pm UTC](https://forum.hestiacp.com/t/how-can-i-enable-shell-exec/11955/6 "2023-12-18T15:08:54Z")

</div>

Closed on December 18, 2023, 3:08pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
