Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    May 2007
    Posts
    18

    Default enable safe_mode for particular account

    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. #2
    Member
    Join Date
    Feb 2003
    Posts
    291

    Default

    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,
    Mitul

  3. #3
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by mitul View Post
    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,
    .htaccess PHP directives will not work for SuPHP servers. Details at:

    http://www.cpanel.net/support/docs/e..._requests.html

  4. #4
    Member
    Join Date
    May 2007
    Posts
    18

    Default

    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. #5
    Member
    Join Date
    Jul 2006
    Posts
    28

    Default

    Don't forget to restart the httpd service.

  6. #6
    Member
    Join Date
    May 2007
    Posts
    18

    Default

    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. #7
    Member
    Join Date
    May 2006
    Location
    Morocco
    Posts
    158
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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. #8
    Member
    Join Date
    May 2006
    Location
    Morocco
    Posts
    158
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    anyone for this ??? !!!!

  9. #9
    Member
    Join Date
    Aug 2005
    Location
    Planet Earth
    Posts
    74

    Default

    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.
    Last edited by RizyDeWino; 12-26-2007 at 07:52 AM.
    The world is my country, all mankind is my brethren, and doing good is my religion - Thomas Paine

  10. #10
    Member
    Join Date
    May 2006
    Location
    Morocco
    Posts
    158
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by RizyDeWino View Post
    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.
    i have tested it with no result . i use php as cgi and not as a module .

Similar Threads & Tags
Similar threads

  1. Disable Safe_mode in user cpanel account
    By activa in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 09-11-2010, 06:59 PM
  2. PEAR and safe_mode
    By nazoreen in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-05-2009, 09:14 AM
  3. Global safe_mode ON, want Local safe_mode OFF
    By hoball in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 06-04-2009, 10:29 AM
  4. Set Safe_mode On and Off!
    By yawsh in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 01-03-2007, 03:41 PM
  5. PHP safe_mode
    By Echelon17 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-16-2006, 10:00 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube