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.

Need safe mode On but for only 1 client

Discussion in 'General Discussion' started by verticalhost, Dec 23, 2005.

  1. verticalhost

    verticalhost Active Member

    Joined:
    Apr 28, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Fort Walton Beach, FL
    I currently run php safe mode off. I have a client requesting that his account have safe mode turned on.

    I am running CentOS 3.4 and have php 5.04, zend, phpsuexec and more.
    I've tried php_admin_flag safe_mode 1 but no prevail.

    Please advise.

    Thanks,
    David Guerra
     
  2. tuxdesk

    tuxdesk Well-Known Member

    Joined:
    Oct 1, 2005
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    php_admin_flag safe_mode On

    try this in /usr/local/apache/conf/httpd.conf
     
    #2 tuxdesk, Dec 24, 2005
    Last edited: Dec 24, 2005
  3. __arjun__

    __arjun__ Guest

    That should be entered your clients virtualhost entry, otherwise the changes would be global.
    Another solution is to use .htaccess file to control this ( But I am not sure whether this works or not. Check it out in any case )

    Code:
    php_flag safe_mode 1
    
    If this doesn't work, then adding the following lines

    Code:
     php_admin_flag safe_mode on 
    in your clients virtualhost entry would be enough.


    BTW, have you confirmed that php safe mode for your client is indeed off?
    Just setup one phpinfo page for your client and check if its indeed off.
     
  4. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    This will not work with apache compiled with phpSuExec. You must use a php.ini file in the users web root or a directory the script is called from.

    Safe mode on or off is not a concern when phpSuexec is used. But if your client wants it turned on then a php.ini file in the web root (public_html) or the directory where a php script is called, with:
    safe_mode = On
    will do the trick.

    When safe mode was turned on it would take a fit if the UID/GID were different to the clients but with phpSuExec this is not a problem as all UID/GIDs belong to the client.

    As David (verticalhost) has phpSuExec installed any reference to a .htaccess file is irrelevant.


    :)
     
    #4 Izzee, Dec 24, 2005
    Last edited: Dec 24, 2005
  5. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth

    You can do it for one account by adding the following line in the .htaccess file:

    php_flag safe_mode on

    But make sure that you cannot alter the php.ini settings with .htaccess when running PHP as cgi/phpsuexec.

    Check this link,

    http://webhostingtalk.com/showthread.php?t=421482
     
  6. verticalhost

    verticalhost Active Member

    Joined:
    Apr 28, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Fort Walton Beach, FL
    Thanks for the advise. I will try these and let you know which one worked.
     
  7. verticalhost

    verticalhost Active Member

    Joined:
    Apr 28, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Fort Walton Beach, FL
    Just for the usefulness of everyone else.

    If you have php safemode off and phpsuexec enabled, then you can safemode a single user account by adding a file named php.ini in the public_html folder.

    The contents of php.ini should be

    --------cut-----------

    safe_mode = On

    --------cut-----------

    Works like a charm.

    Thanks!
     
  8. verticalhost

    verticalhost Active Member

    Joined:
    Apr 28, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Fort Walton Beach, FL
    Sorry,

    Not everything is a charm yet.

    When adding the php.ini file it only does 1 directory.
    The user is needing all directories to be in safe mode.
    Anymore ideas?
     
  9. tuxdesk

    tuxdesk Well-Known Member

    Joined:
    Oct 1, 2005
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
Loading...

Share This Page