Turning off magic quotes in six easy steps

Turning off magic quotes magic_quotes_gpc

Magic Quotes is a process that automatically breaks away the incoming data to the PHP script. Thus, it is always suggested to code with the Magic Quotes off and to instead escape the data at runtime.

Many Open Source Software programs like Drupal, Joomla require magic_quotes_gpc to be turned off. In this article, we will be describing the detail steps on how to turn off magic_quotes_gpc.

How to turn off magic_quotes_gpc

Step 1: Login into your cPanel

Step 2: Go to the File Manager, Select your public_html directory and press GO

Step 3: Open your php.ini with the code editor Find the magic_quotes_gpc line like the code below and change it from On to Off.(Refer to the following fig)

Magic_quotes_gpc
Magic_quotes_gpc

[su_code];Magic quotes
;
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On
[/su_code]

You should change the value of php.ini as per bellow code.

[su_code]
;Magic quotes
;
; Magic quotes for incoming GET/POST/Cookie data.

magic_quotes_gpc = Off
[/su_code]


Step 4:
Save the changes.

Step 5:  Make the php.ini recursive in the .htaccess

Step 6:  To verify the changes, visit your phpinfo page by going to your domain and adding phpinfo.php at the end of the URL like the example below.

magic_quotes_gpc successfully turned off
magic_quotes_gpc successfully turned off

We hope this article is helpful. Comment below for any queries.