Skip to main content

Best practice php ini_set()

Comments

5 comments

  • quizknows
    I personally disallow ini_set() under disable_functions. If a user needs custom php.ini, I use SuPHP which allows them to have their own. You could make the php.ini file itself root owned if you're worried about the user editing it. In this case, what I do is: copy /usr/local/lib/php.ini to /home/$user/public_html/php.ini Add this code anywhere inside /home/$user/public_html/.htaccess suPHP_ConfigPath /home/$user/public_html order allow,deny deny from all
    Again, if you leave the new php.ini owned as root, user cannot edit it. If you want to let them edit it, chown it to them. Of course if they really wanted to be mean they could edit their htaccess to specify another configpath, but you could also root own their .htaccess If you don't use SuPHP, I'm sorry for advice being worthless ;)
    0
  • quietFinn
    [quote="quizknows, post: 1488661"> Again, if you leave the new php.ini owned as root, user cannot edit it.
    But they can delete it, and then create their own php.ini, which they can edit.
    0
  • quizknows
    Ouch. Forgot about that. chattr +i php.ini would be in order then, but a little bit overkill and probably not a good solution for a ton of accounts.
    0
  • niceboy
    I use php ini manager and it works fine until now(with suphp).. [url=http://how2.be/en/community/phpinimgr/]PHP.ini Manager - How2 Solutions
    0
  • cPanelMichael
    Hello :) The following thread should be useful to you: Methods to increase security with suPHP Thank you.
    0

Please sign in to leave a comment.