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 question

Discussion in 'General Discussion' started by chadi, Jul 30, 2004.

  1. chadi

    chadi BANNED

    Joined:
    Apr 20, 2004
    Messages:
    415
    Likes Received:
    0
    Trophy Points:
    0
    Client says:

    I ned PHP recompiled to include /tmp in open_basedir in the php core so I grab generated files out of there


    How would I go about doing this? I'm not quite sure I understand this
     
  2. FriedEgg

    FriedEgg Active Member

    Joined:
    Sep 27, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Washington, DC
    Shouldn't be necessary to recompile. Open_basedir values are stored in httpd.conf if you have it enabled, the lines look like:

    php_admin_value open_basedir "/home/example:/usr/lib/php:/usr/local/lib/php:/tmp"

    In each virtual host section. As you can see, at least for me, /tmp is already included.
     
  3. chadi

    chadi BANNED

    Joined:
    Apr 20, 2004
    Messages:
    415
    Likes Received:
    0
    Trophy Points:
    0
    How do I include it? I've never done this before so please be descriptive. Thanks.
     
  4. FriedEgg

    FriedEgg Active Member

    Joined:
    Sep 27, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Washington, DC
    Login to the shell as root, load up /usr/local/apache/conf/httpd.conf in your favorite text editor (pico, nano, vi, etc), scroll down towards the bottom until you find their virtual host entry, something like (depending on your settings):

    Code:
     
    <VirtualHost www.xxx.yyy.zzz>
    BytesLog domlogs/example.com-bytes_log
    ServerName www.example.com
    ServerAlias example.com www.example.com
    ServerAdmin webmaster@example.com
    DocumentRoot /home/example/public_html
    CustomLog domlogs/example.com combined
    User example
    Group example
    <IfModule mod_userdir.c>
    UserDir disabled
    UserDir enabled example
    </IfModule>
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/example/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    </VirtualHost>
    php_admin_value open_basedir "/home/example/:/usr/lib/php:/usr/local/lib/php:/tmp" is the important part. Just make sure /tmp is in it.

    Of course, this is only applicable if you have WHM > Tweak Security > php open_basedir Tweak > Enable php open_basedir Protection checked, otherwise there is no basedir checking and he should have access to /tmp already.
     
  5. chadi

    chadi BANNED

    Joined:
    Apr 20, 2004
    Messages:
    415
    Likes Received:
    0
    Trophy Points:
    0
    Strangely the virtual host for the domain is not even there. Why would that be?
     
  6. chadi

    chadi BANNED

    Joined:
    Apr 20, 2004
    Messages:
    415
    Likes Received:
    0
    Trophy Points:
    0
    nevermind I found it...customer didn't clarify that he's a dedicated customer not shared.

    question:
    php_admin_value open_basedir "/home/example/:/usr/lib/php:/usr/local/lib/php:/tmp"

    is "/home/example" the way it should be or the actual user's account?
     
  7. FriedEgg

    FriedEgg Active Member

    Joined:
    Sep 27, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Washington, DC
    Use their real account name.
     
  8. chadi

    chadi BANNED

    Joined:
    Apr 20, 2004
    Messages:
    415
    Likes Received:
    0
    Trophy Points:
    0
    Ok now he wants i across the entire server not one account. Where exactly would that go?
     
  9. chadi

    chadi BANNED

    Joined:
    Apr 20, 2004
    Messages:
    415
    Likes Received:
    0
    Trophy Points:
    0
    what protection?
     
  10. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    hehe...this was a cool thread.

    Remove the Open Base Dir protection.
    Whm/Tweak Security/

    not neccessary if it's a dedicated server is it.
     
Loading...

Share This Page