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 / suphp / suhosin

Discussion in 'General Discussion' started by gsus, Sep 9, 2009.

  1. gsus

    gsus Registered

    Joined:
    Jun 13, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi cPanellllllers,

    i'm currently having a bit of grief trying to figure out what to do with custom php.ini files with suphp.

    As you know already php.ini files don't stack, so if you use a custom php.ini file with only a few settings in it (eg memory_limit, register_globals) it will set these, but every non specified setting results back to defaults rather then what your global php.ini says they should be.

    My questions are:
    • What do you guys/gals do to sort this out? do you put full copies of your php.ini in public_html directories and scramble to update them all every time you need to make a change, or do you do opt to use something other then suphp because of this problem?
    • How do you enforce suhosin limits if the global php.ini file does not get read whenever a custom one is used? eg how do I put a celing on memory_limit if the global php.ini isnt being read?
     
  2. MattCurry

    MattCurry Well-Known Member

    Joined:
    Aug 18, 2009
    Messages:
    275
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Houston, Tx
    php.ini

    Hello,

    I do see what you are trying to accomplish with your question. However there is only two basic ways to setup the php.ini that cpanel uses. One, you could use the global php.ini as you asked, or put a php.ini in the users public_html directory.
    As far as the memory question goes you can set a memory limit per script in the php.ini using 'memory_limit=128m', and I put 128m in there but you can put whatever you like within reason.

    I hope this gets your question answered.

    Thank you,
    Matthew Curry
     
  3. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    You may copy the entire server level php.ini file in the client's public_html folder or specify the path of the php.ini file that is used for that particular client. You can place php.ini anywhere and have this directive in public_html/.htaccess

    suPHP_ConfigPath /home/username/php5-config

    As you say, any undefined variable is set to default rather than what global php.ini specifies, so logical choice would be to copy the entire php.ini file at a specific path under root ownership and define the path of the php.ini file in .htaccess.
     
  4. gsus

    gsus Registered

    Joined:
    Jun 13, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    the 2 problems copying the global php.ini to the users directories and editing it are extension path changes in future upgrades will mean I have to search out and edit every custom php.ini, and not being able to put an upper limit on things like memory_limit - with suhosin + php cgi you could specify suhosin.memory_limit as an upper value, set your default memory_limit and that way if customers wanted more then the default they could set something reasonable and if they set anything higher then the suhosin.memory_limit either via the script itself or .htaccess php_value's it would only reach the suhosin.memory_limit.

    surely there has to be a better way? id switch back to non suphp methods if they didn't break whilst using mod_userdir...
     
  5. DjiXas

    DjiXas Well-Known Member

    Joined:
    Feb 10, 2007
    Messages:
    294
    Likes Received:
    0
    Trophy Points:
    16
    set php override to no
     
Loading...

Share This Page