Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

enable safe_mode for particular account

Discussion in 'General Discussion' started by valleytech, Nov 6, 2007.

  1. valleytech

    valleytech Member

    Joined:
    May 11, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    151
    hi,
    I have turned ON php safe_mode to prevent local hacking.
    However, some of my clients are using osCommerce as well as zen cart to provide online shopping which require safe_mode to be OFF.

    I have realized that there're several different php.ini across the server: /usr/local/lib, /usr/local . . .

    Is it possible for me just to enable safe_mode ON for particular account?

    thanks so much!
     
  2. mitul

    mitul Well-Known Member

    Joined:
    Feb 8, 2003
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    166
    Yes you can enable safe_mode for a particular domain. Add the below entry under virtual host in httpd.conf or in .htaccess under document root folder.

    php_value safe_mode on

    Regards,
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    .htaccess PHP directives will not work for SuPHP servers. Details at:

    http://www.cpanel.net/support/docs/ea/ea3/ea3php_php_requests.html
     
  4. valleytech

    valleytech Member

    Joined:
    May 11, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    151
    thanks!!!

    I want to globally enable SAFE_MODE tobe ON
    and use the php directory in httpd.conf to disable safe_mode on each account.

    it's not working!
    am I missing anything?

    thanks!!
     
  5. TheHeartSmasher

    TheHeartSmasher Active Member

    Joined:
    Jul 14, 2006
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    151
    Don't forget to restart the httpd service.
     
  6. valleytech

    valleytech Member

    Joined:
    May 11, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    151
    thanks millions!
    But, I sure knew the process to apply new configuration to PHP/apache, in this case, it still didn't work.
    Besides,
    I have open_dir_restriction ON, also using .htacess. Will that be a problem?

    thanks!!!
     
  7. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    207
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    i have semilar sitution

    php 5.2.5
    apche 2.2
    suphp

    how i can disable safe mode for 1 account ....

    i have search in the httpd.conf and i found this

    Code:
        ServerName xxxx.com
        ServerAlias www.xxxx.com xxxxx.com
        DocumentRoot /home/xxxxx/public_html
        ServerAdmin webmaster@xxxxxx.com
        UseCanonicalName Off
    
        TransferLog /usr/local/apache/domlogs/xxxx.com
        CustomLog /usr/local/apache/domlogs/xxxx.com-bytes_log "%{%s}t %I .\n%{%s$
        ## User sansnom # Needed for Cpanel::ApacheConf
        UserDir disabled
        UserDir enabled xxxxxxx
        <IfModule mod_suphp.c>
            suPHP_UserGroup xxxxx xxxxx
        </IfModule>
        <IfModule concurrent_php.c>
            php4_admin_value open_basedir "/home/xxxx:/usr/lib/php:/usr/php4/lib$
            php5_admin_value open_basedir "/home/xxxx:/usr/lib/php:/usr/local/li$
        </IfModule>
        <IfModule !concurrent_php.c>
            <IfModule mod_php4.c>
                php_admin_value open_basedir "/home/xxxxx:/usr/lib/php:/usr/php4/$
            </IfModule>
            <IfModule mod_php5.c>
                php_admin_value open_basedir "/home/xxxxx:/usr/lib/php:/usr/local$
            </IfModule>
            <IfModule sapi_apache2.c>
                php_admin_value open_basedir "/home/xxxxx:/usr/lib/php:/usr/php4/$
            </IfModule>
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            SuexecUserGroup xxxxxx xxxxxx
        </IfModule>
        ScriptAlias /cgi-bin/ /home/xxxxxx/public_html/cgi-bin/

    in wich part chould i add the commande line to disable the safe mode ?
     
  8. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    207
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    anyone for this ??? !!!!
     
  9. RizyDeWino

    RizyDeWino Well-Known Member

    Joined:
    Aug 1, 2005
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Planet Earth
    Disable it in 'IfModule mod_php4.c' , 'IfModule mod_php5.c' and 'sapi_apache2.c' section.

    php_admin_value safe_mode On/Off (as per your requirement)


    Also visit the link 'http://www.cpanel.net/support/docs/ea/ea3/ea3php_php_requests.html' pasted by cPanelDavidG above , as the exact way in which this should be done also depends on your server setup.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #9 RizyDeWino, Dec 26, 2007
    Last edited: Dec 26, 2007
  10. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    207
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    i have tested it with no result . i use php as cgi and not as a module .
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice