You are here:Home»KB»Web Server»htaccess»Disable Magic Quotes via htaccess
Sunday, 22 February 2015 20:07

Disable Magic Quotes via htaccess

Written by

This is a method to disable 'Magic Quotes' when you need to turn them off for such things as joomla. The following instructions are to get your system php.ini file, disable Magic Quotes in this file, and then get the system to load the new file and overide the system php.ini using a command in your .htaccess file.

Please follow the instructions below:

  1. download a copy of the system php.ini (/usr/local/lib/php.ini)
  2. modified the following line
    ; Magic quotes for incoming GET/POST/Cookie data.
    magic_quotes_gpc = On
    To
    ; Magic quotes for incoming GET/POST/Cookie data.
    magic_quotes_gpc = Off
  3. upload the file to somewhere on your webserver, preferably outside of your public_html folders but not required
  4. create/edit your route .htaccess and add the following line which references the new php.ini file
    <IfModule mod_suphp.c>
      suPHP_ConfigPath /home/example/public_html
      <Files php.ini>
        order allow,deny
        deny from all
      </Files>
    </IfModule>
Read 884 times