MilesWeb
Leading Web Hosting Provider in India Since 2012.
Award-winning Web Hosting Company
Everything that you need to build, host and manage a website is available at just 109/mo

How to enable/disable Magic Quotes GPC ?

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn5

Magic Quotes is a process that automatically escapes incoming data to the PHP script. This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0. It’s preferred to code with magic quotes off and to instead escape the data at runtime, as needed.

You can enable/disable magic_quotes_gpc in php.ini & .htaccess depending on how php/apache are compiled.

1. Enable/disable using php.ini.
Copy server’s php.ini under your public_html. Find for magic_quotes_gpc. Set it to On OR Off as required.

Now, open .htaccess and add “SetEnv PHPRC /home/user/public_html”. Doing this, the php.ini will be used by all files & directories. Not just the main directory.

2. Enable/disable using .htaccess.
Adding the following line will disable it. Change from off to on if you want it to be enabled.

php_flag magic_quotes_gpc off

With our affordable hosting plans you can enable/disable it in php.ini file.

Leave a Reply

Your email address will not be published. Required fields are marked *