Skip to main content

PHP-FPM and PHP.INI

Comments

19 comments

  • cPanelMichael
    Hello, This is answered on the following thread: Enabling PHP-FPM in MultiPHP Manager Thanks!
    0
  • hrace009
    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.
    0
  • cPanelMichael
    Edited with updated instructions: Hello, To update, the following resource is now available for this topic: Tutorial - Managing php.ini directives with PHP-FPM Thank you.
    0
  • teo_
    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
    ; 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.
    0
  • teo_
    but nothing has changed

    Hem, sorry, it worked: I was watching the wrong folder :oops:
    0
  • jonh
    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.
    0
  • digitaliway
    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.
    0
  • cPanelMichael
    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.
    0
  • Jonathan Moore
    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,
    0
  • cPanelMichael
    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.
    0
  • Jonathan Moore
    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
    0
  • Jonathan Moore
    I noticed a couple of additional points during testing: [LIST]
  • 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
  • 0
  • cPanelMichael
    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.
    0
  • Jonathan Moore
    Is CPANEL-11563 the same as EA-5425? it appears some other users are fixing by changing the [domain].php-fpm.yaml for each domain as per: Enabling PHP-FPM in MultiPHP Manager verified by users on: Topic: No way to enable Extended Protection " WordPress.org Forums
    0
  • cPanelMichael
    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.
    0
  • Jonathan Moore
    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
    0
  • anithegregorian
    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.
    0
  • anithegregorian
    FYI running PHP as suPHP does that affect overriding
    0
  • cPanelMichael
    Hello @anithegregorian, The "disable_functions" option is only changeable in the global php.ini and not on a per-account basis. Thank you.
    0

Please sign in to leave a comment.