Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php.ini (user.ini) in php-fpm and subdirectories

Discussion in 'EasyApache' started by opt2bout, Jun 10, 2017.

Tags:
  1. opt2bout

    opt2bout Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    156
    I have found a couple of threads on internal case issues and reports regarding php.ini (or .user.ini and .htaccess) to override default PHP settings per domain.

    I have even opened up a case, and closed it thinking the issue was resolved.

    With an fpm enabled account, the php.ini overrides only apply to that directory. Subdirectories below are requiring that we copy the .user.ini to each directory where we have an application below the root public_html.

    Is this the way its supposed to work? If so, are there any alternatives to fpm for performance that work where we can just set a single php configuration file at the root and have it apply to all sub-directories?
     
  2. Anoop P Alias

    Anoop P Alias Well-Known Member

    Joined:
    Mar 31, 2015
    Messages:
    76
    Likes Received:
    10
    Trophy Points:
    8
    Location:
    Kochi,Kerala,India
    cPanel Access Level:
    Root Administrator
    The .user.ini is a per directory ini file and affects on the directory the file resides.

    If you need to change php.ini settings on a global scale edit multiPHP ini editor in WHM or if you wish to do this on a per domain basis, you can edit the php-fpm pool file that cPanel creates for the domain which will then affect all directories.
     
  3. opt2bout

    opt2bout Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    156
    So the only way to change php.ini setting using php-fpm is to have the system administrator modify the /opt/cpanel/ea-php70/root/etc/php-fpm.d/[[domain]].conf file and restart fpm? So shouldn't the settings in the user's cPanel be disabled?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It looks to relate to the internal case referenced on the following thread:

    .user.ini files not recursive

    Let us know if the workaround referenced on that thread helps.

    Thank you.
     
  5. opt2bout

    opt2bout Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    156
    Was building a new server and got delayed in testing this. Yes, this change fixed the issue. We can now have one .user.ini in the public_html directory and all sub-directories are applied. Ideally this would work if we chose to place the .user.ini file in the home directory as well.
     

Share This Page