Skip to main content

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

Comments

6 comments

  • Anoop P Alias
    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.
    0
  • opt2bout
    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?
    0
  • cPanelMichael
    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.
    0
  • opt2bout
    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.
    0
  • bgarrant
    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.

    Did you try a .user.ini in the home directory (/home/user)? It does seem to work recursively. Just wondering if it is OK to do it this way as all the docs I see say to have the .user.ini in the public_html folder. Also, how can I make it so my clients can't modify the .user.ini file? I am trying to use this to just add an open_basedir restriction.
    0
  • cPanelMichael
    Did you try a .user.ini in the home directory (/home/user)? It does seem to work recursively. Just wondering if it is OK to do it this way as all the docs I see say to have the .user.ini in the public_html folder. Also, how can I make it so my clients can't modify the .user.ini file? I am trying to use this to just add an open_basedir restriction.

    Hello, We recommend using the INI Editor in cPanel to make these types of changes as this ensures the proper entries/files are automatically populated in the event the handler changes in the future. There's not currently a supported method to prevent user modifications to individual PHP configuration files with suPHP, aside from the workarounds referenced in this post: How to configure SuPHP to use only the MultiPHP INI file, not user inis, and open_basedir? Thank you.
    0

Please sign in to leave a comment.