Tuesday, July 9, 2013

How to enable or disable safe_mode with .htaccess or php.ini

Sometimes you need to turn off safe mode on PHP for a page to load properly. There are several options to allow this and they are to
  1. Turn off safe mode for a domain with the .htaccess file:
    Put this line inside .htaccess file to turn it off:
    php_value safe_mode offif the above does not work try:
    php_flag safe_mode offalso try substituting the "off" word with: 0
    Eg: php_value safe_mode 1 
  2. The other option is to create/modify a php.ini file in the cgi-bin folder and have the line
    safe_mode = off Or if you wish to turn off safe mode for the entire server
    modify the /etc/php.ini and set safe_mode = On to safe_mode = off.
Disqus Comments