enable safe_mode for particular account

valleytech

Member
May 11, 2007
18
0
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!
 

mitul

Well-Known Member
Feb 8, 2003
291
0
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,
 

valleytech

Member
May 11, 2007
18
0
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!!
 

valleytech

Member
May 11, 2007
18
0
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!!!
 

activa

Well-Known Member
May 23, 2006
213
1
168
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 [email protected]
    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 ?
 

RizyDeWino

Well-Known Member
Aug 1, 2005
74
0
156
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.
 
Last edited:

activa

Well-Known Member
May 23, 2006
213
1
168
Morocco
cPanel Access Level
Root Administrator
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 .