Tuesday, 23 March 2010

Turning off Magic Quotes on cPanel



This is actually quite easy. magic_quotes_gpc can't be turned off at runtime (which means no ini_set).

Therefore you must put a php.ini file inside your root (highest) directory (/home/myusername/) and as it's contents type;
[PHP]

magic_quotes_gpc = Off

Don't worry about making sure all of the other variables are in the file, they will all fall back to the current server-wide php.ini file, so you only need to type the variables you want to change.

Or in .htaccess file within your /public_html/ folder
php_flag magic_quotes_gpc Off

It's that simple.

No comments:

Post a Comment