PHP-FPM custom configuration for subdomain

andreluiz

Registered
Oct 29, 2018
2
0
1
Brusque - SC - Brasil
cPanel Access Level
DataCenter Provider
Hello everyone,

I have a customer which needed to enable the "exec" function in PHP 7.0. What I did was to edit the following file:

/opt/cpanel/ea-php70/root/etc/php-fpm.d/subdomain.domain.com.conf

I removed "exec" from php_admin_value[disable_functions].

The problem is that at the top of the file, there's the following message:

; NOTICE This file is generated. Please use our WHM User Interface
; to set these values.


Ok, but where do I edit it in WHM? I didn't find the page to do this.
I can find only the main PHP.ini configuration, which already has disable_functions empty.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Hello @andreluiz,

It's not currently possible to modify the value using Web Host Manager (though that is planned for a future version). We have a guide on how to make the change for an individual domain (or subdomain) at:

Tutorial - Managing php.ini directives with PHP-FPM

Let me know if following the instructions on the above resource helps.

Thank you.
 

andreluiz

Registered
Oct 29, 2018
2
0
1
Brusque - SC - Brasil
cPanel Access Level
DataCenter Provider
Well, I did as described in the guide. Apparently, it didn't work because phpinfo still showed exec inside disable_function, but the PHP script worked normally as if exec was not disabled. That's strange, anyway, just in case, I did the same thing I did in my first post, just to guarantee that exec will work.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Apparently, it didn't work because phpinfo still showed exec inside disable_function, but the PHP script worked normally as if exec was not disabled.
Hello @andreluiz,

This is an artifact of how PHP and PHP-FPM work together. It's noted under the Caveat - PHP_INI_SYSTEM mode section in the linked resource.

Thank you.