Plesk

Domain’s PHP functional is not available: xxx() has been disabled for security reasons

Symptoms

Cause

PHP function xxx() is disabled in php.ini.

Resolution

Warning: These steps ONLY apply to PHP-FastCGI, they do NOT apply for PHP-FPM, because for FPM disabled_functions directives will get overwritten by the Global PHP Configuration.

Configuring disable_functions in Plesk interface for a particular domain:

  1. Log into Plesk;

  2. Go to Domains > example.com > PHP Settings, remove everything from disable_function section > OK:

    In case there is no disable_function section add the following line in Additional configuration directives field in Domains > example.com > PHP Settings > Additional directives to override main php.ini directives:

    disable_functions=""

Note: For the server-wide ways, check what PHP handler is enabled in Plesk > Home > Domains > example.com > PHP Settings . Let it be PHP 8.1.

Configuring disable_functions in Plesk interface server-wide:

  1. Log into Plesk;

  2. Go to Tools & Settings > PHP Settings > <PHP handler version> > php.ini;

  3. Find disable_functions and remove xxx from the list. Press OK to save changes.

Configuring disable_functions server-wide via SSH:

  1. Connect to the server via SSH.

  2. Check that disable_functions is enabled in the php.ini of the handler in use:

    # grep xxx /opt/plesk/php/8.1/etc/php.ini | grep disable
    disable_functions = xxx,mail,curl_multi_exec,dl,exec,passthru,proc_open,proc_close,shell_exec,show_source,symlink,system,show_source, popen

  3. Open php.ini file with text editor, i.e. vi editor:

    # vi /opt/plesk/php/8.1/etc/php.ini

  4. Find the line with disable_functions and delete xxx function from the list of disabled functions.

  5. Restart PHP service:

    # service plesk-php81-fpm restart