Disabled functions (disable_functions)

ChrisDeVe

Active Member
Apr 18, 2018
34
12
8
UK
cPanel Access Level
Root Administrator
Error: API failure: Can't use string ("exec,passthru,shell_exec,system,"...) as a HASH ref while "strict refs" in use at /usr/local/cpanel/Cpanel/PHPFPM.pm line 636.

I can't see any domains now, I try to remove system_pool_defaults.yaml and rebuild it, no luck.


This is my new system_pool_defaults.yaml
---
php_admin_flag_allow_url_fopen: 'on'
php_admin_flag_log_errors: 'on'
php_admin_value_disable_functions: exec
php_admin_value_doc_root: "\"[% documentroot %]/\""
php_admin_value_error_log: "[% homedir %]/logs/[% scrubbed_domain %].php.error.log"
php_admin_value_short_open_tag: 'on'
php_value_error_reporting: E_ALL & ~E_NOTICE
pm_max_children: 5
pm_max_requests: 20
pm_process_idle_timeout: 10


USE:
Centos : 7.6
CPanel : v78.0.11
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,275
313
Houston
HI @ChrisDeVe


How were you making changes to the PHP-FPM configuration? My default system_pool_defaults.yaml looks as follows:

Code:
[[email protected] ~]# cat /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml
---
php_admin_flag_allow_url_fopen: 'on'
php_admin_flag_log_errors: 'on'
php_admin_value_disable_functions: exec,passthru,shell_exec,system
php_admin_value_doc_root: "\"[% documentroot %]/\""
php_admin_value_error_log: "[% homedir %]/logs/[% scrubbed_domain %].php.error.log"
php_admin_value_short_open_tag: 'on'
php_value_error_reporting: E_ALL & ~E_NOTICE
pm_max_children: 5
pm_max_requests: 20
pm_process_idle_timeout: 10
And the following article goes over how to manually modify these directives: Tutorial - Managing php.ini directives with PHP-FPM

But we also introduced a user interface to manage some of these in v78 of cPanel at WHM>>Software>>MultiPHP -> System PHP-FPM Configuration
 

ChrisDeVe

Active Member
Apr 18, 2018
34
12
8
UK
cPanel Access Level
Root Administrator
Hi Lauren

Thank you for your answer.

I try your config, same issue, I try to remove all settings and let CPanel to regenerate "system_pool_defaults.yaml" after adding a single ( Disabled functions (disable_functions)) or multiple.

The error will stay as well if I remove from ( Disabled functions (disable_functions)) all and leave empty

Thank you
 

Attachments

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,275
313
Houston
Hi @ChrisDeVe


I apologize, this must have been overlooked. It sounds like there's an issue with that disable functions line. Can you show me the system_pool_defaults.yaml?
 

ChrisDeVe

Active Member
Apr 18, 2018
34
12
8
UK
cPanel Access Level
Root Administrator
---
php_admin_flag_allow_url_fopen: 'on'
php_admin_flag_log_errors: 'on'
php_admin_value_disable_functions: "\"\""
php_admin_value_doc_root: "\"[% documentroot %]/\""
php_admin_value_error_log: "[% homedir %]/logs/[% scrubbed_domain %].php.error.log"
php_admin_value_short_open_tag: 'on'
php_value_error_reporting: E_ALL & ~E_NOTICE
pm_max_children: 5
pm_max_requests: 20
pm_process_idle_timeout: 10
 

ChrisDeVe

Active Member
Apr 18, 2018
34
12
8
UK
cPanel Access Level
Root Administrator
In empty will be like that

So I add for example

---
php_admin_flag_allow_url_fopen: 'on'
php_admin_flag_log_errors: 'on'
php_admin_value_disable_functions: exec
php_admin_value_doc_root: "\"[% documentroot %]/\""
php_admin_value_error_log: "[% homedir %]/logs/[% scrubbed_domain %].php.error.log"
php_admin_value_short_open_tag: 'on'
php_value_error_reporting: E_ALL & ~E_NOTICE
pm_max_children: 5
pm_max_requests: 20
pm_process_idle_timeout: 10

This will be default now.

Error: API failure: Can't use string ("exec") as a HASH ref while "strict refs" in use at /usr/local/cpanel/Cpanel/PHPFPM.pm line 636.

It's seem like faild on this line

if ( $pool->{$key}{'present_ifdefault'} ) {
$pool->{$key}{'value'} = $domain_pool_hr->{$key}{'default'} // $system_pool_defaults_hr->{$key}{'default'} // $php_fpm_pool_directives{$key}{'default'};
}
 
Last edited:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,275
313
Houston
Hi @ChrisDeVe


We've been trying to reproduce the error you're encountering but are unable to. Would it be possible for you to please open a ticket with us using the link in my signature? Once open please update this thread with the ticket ID so that we can add the resolution to this thread.

Thanks!