hrace009

Well-Known Member
Dec 24, 2013
75
10
8
Root
cPanel Access Level
Root Administrator
Twitter
I have upgrade to V60 and using php-fpm from interfaces WHM, and everything running correctly.
But seems php-fpm cannot load php.ini at domain root directory.
PHP-FPM always load default php.ini
Anyone can help to solve this problem?

Thank You
 

hrace009

Well-Known Member
Dec 24, 2013
75
10
8
Root
cPanel Access Level
Root Administrator
Twitter
Hello,

This is answered on the following thread:

Enabling PHP-FPM in MultiPHP Manager

Thanks!
hi thanks for the reply, but seems doesn't solved my problem, since i don't see anything relate with php.ini

when i turn off PHP-FPM, i can use costume php.ini from domain root directory.
but if i enable PHP-FPM, it can't use costume php.ini from domain root directory.
 

teo_

Member
Nov 21, 2008
13
1
53
It's not possible at this time. You have to actually edit the "/opt/cpanel/ea-php$$/root/etc/php-fpm.d/domain.com.conf" file instead of the php.ini file.
I tried to change some values from this file /opt/cpanel/ea-php56/root/etc/php-fpm.d/my.domain.conf like
Code:
; php_admin_value[error_log] = /home/myhome/logs/my_domain.php.error.log
php_admin_value[error_log] = /home/myhome/logs/my_domain.php.errortest.log
then I used the command
/etc/init.d/ea-php56-php-fpm restart

but nothing has changed: I still see the old error log growing.
 

jonh

Well-Known Member
Feb 15, 2016
86
5
8
NY
cPanel Access Level
Root Administrator
Can you just copy the php.ini contents into the my.domain.conf or do they have to be formatted differently?

All of our sites use a security plugin which relies on php.ini or user.ini in the domains public html folder and they all do not work now because of this.
 

digitaliway

Active Member
Feb 17, 2015
29
2
53
cPanel Access Level
Root Administrator
Can someone just provide a simple step by step way to make an adjustment PER DOMAIN WHILE USING PHP FPM for max_execution_time, input vars, memory??

I tried to change the file /opt/cpanel/ea-php56/root/etc/php-fpm.d/my.domain.conf - by SSH and I get this message:
; NOTICE This file is generated, please use our WHM User Interface
; to set these values.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
Can someone just provide a simple step by step way to make an adjustment PER DOMAIN WHILE USING PHP FPM for max_execution_time, input vars, memory??

I tried to change the file /opt/cpanel/ea-php56/root/etc/php-fpm.d/my.domain.conf - by SSH and I get this message:
; NOTICE This file is generated, please use our WHM User Interface
; to set these values.
Edit:

Hello,

The following resource is now available for this topic:

Tutorial - Managing php.ini directives with PHP-FPM

Thank you.
 
Last edited:
  • Like
Reactions: linux4me2
Feb 26, 2017
15
1
3
London
cPanel Access Level
Root Administrator
I have the same issue as @jonh the "security plugin which relies on php.ini or user.ini in the domains public html folder and they all do not work now because of this"

The plugin adds a directive:
auto_prepend_file = [filepath]

the conversation has then tracked into modifying the pool settings via the yaml which doesn't address this case.

There is a reference above to an earlier message I don't have permission to see with a quote:
"It's not possible at this time. You have to actually edit the "/opt/cpanel/ea-php$$/root/etc/php-fpm.d/domain.com.conf" file instead of the php.ini file."

So do I actually have to go through copying all info from user.ini from all sites into these .conf files?
jonh was also asking: "Can you just copy the php.ini contents into the my.domain.conf or do they have to be formatted differently?"

also, the domain files in /opt/cpanel/ea-php70/root/etc/php-fpm.d
have a notice:
"
; NOTICE This file is generated, please use our WHM User Interface
; to set these value.
"
so in that case the files should not be edited manually?

was this answered?

thanks,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
Hello @Jonathan Moore,

The intention is that changes made via cPanel's MultiPHP INI Editor are enacted no matter the PHP handler. I believe the issue you are noticing is related to an internal case that's open related to PHP-FPM and php.ini modifications. A link to the thread where this is discussed is located at:

MultiPHP INI Editor file name .user.ini instead of php.ini

Thank you.
 
Feb 26, 2017
15
1
3
London
cPanel Access Level
Root Administrator
Hi, thanks for reply, I'm not sure if it's the same or not.
I am not referring to changes made by MultiPHP INI Editor.
The question is about.ini entries in the domain root directory being ignored when PHP-FPM is enabled.

In this case a widely used security tool that adds itself to all php requests for each site by adding a user.ini entry for auto_prepend_file = [filepath]
(actually more than one tool that does this from my observations on the WordPress support forums)

Since turning on PHP-FPM this is not working and it's not quite clear from this thread whether the entries should be added manually or via WHM into my.domain.conf in /opt/cpanel/ea-php70/root/etc/php-fpm.d or into other .ini file
 
Feb 26, 2017
15
1
3
London
cPanel Access Level
Root Administrator
I noticed a couple of additional points during testing:
  • phpinfo() from the root url shows the local setting applied [even though the local config file does not appear in "Additional .ini files parsed"], however a phpinfo() called from any subdirectory does not show the setting, whereas normally it would.
  • there is an entry: /opt/cpanel/ea-php71/root/etc/php.ini:661:auto_prepend_file = and it is suggested that in some circumstances this entry suppresses user settings, though I was unable to verify by commenting this line out
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
Hello @Jonathan Moore,

Could you open a support ticket using the link in my signature so we can take a closer look at the affected system and verify if the issue is related to internal case CPANEL-11563? You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
Is CPANEL-11563 the same as EA-5425?
CPANEL-11563 relates to changes made through the cPanel MultiPHP INI Editor not reflecting within PHP-FPM. EA-5425 relates to custom PHP-FPM values overriding the global PHP configuration values configured in WHM's MultiPHP INI Editor feature.

In either case, I recommend opening a support ticket so we can take a closer look and verify what's happening on the system.

Thank you.
 
Feb 26, 2017
15
1
3
London
cPanel Access Level
Root Administrator
I was able to verify this type of workaround commented on other threads and forums:
1.Edit the file /var/cpanel/userdata/[user]/[domain].php-fpm.yaml
2.Add the line:
php_admin_value_auto_prepend_file: { name: 'php_admin_value[auto_prepend_file], value: '/home/[user]/public_html/wordfence-waf.php' }
3.Rebuild the PHP-FPM config for that domain by running:
/scripts/php_fpm_config –-rebuild –-domain=[domain]

In all cases replace [user] with the user account and [domain] with the domain name.

Enabling PHP-FPM in MultiPHP Manager
 
  • Like
Reactions: Del Drago
Dec 25, 2012
5
0
1
cPanel Access Level
Root Administrator
Hey @cPanelMichael ,

Facing same issue on WHM/cPanel version v66.0.24 running CentOS 7 with PHP-FPM (active on all domains) and dual version of PHP 7.1 and 5.6 for backward compatibility.

So, in PHP 5.6 and 7.1 some sensitive PHP functions are disabled in main php.ini like:
disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open

The domain in question is running on PHP 7.1 but when overriding them on that single domain like:
disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open

Overriding and removing just phpinfo from disable_functions just don't seem to work. These functions are disabled for security but exceptional for some domains.

Have tried restarting Apache 2.4 and rebuilding httpconf but nothing happens.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,236
463
Hello @anithegregorian,

The "disable_functions" option is only changeable in the global php.ini and not on a per-account basis.

Thank you.