I want to turn off PHP's magic quotes. I don't have access to php.ini.
When I tried to add php_flag magic_quotes_gpc off to my .htaccess file, I get a 500 internal server error. This is what my .htaccess file looks like:
AddType x-mapp-php5 .php
php_flag magic_quotes_gpc off
Then I tried to use ini_set('magic_quotes_gpc', 'O'), but that had no effect.
How do I turn magic quotes off?
As per the manual you can often install a custom php.ini on shared hosting, where mod_php isn't used and the
php_valuedirective thus leads to an error. For suexec/FastCGI setups it is quite common to have a per-webspacephp.iniin any case.--
I don't think O (uppercase letter o) is a valid value to set an ini flag. You need to use a true/false, 1/0, or "on"/"off" value.
EDIT
After checking the list of ini settings, I see that magic_quotes_gpc is a
PHP_INI_PERDIRsetting (after 4.2.3), which means you can't change it withini_set()(onlyPHP_INI_ALLsettings can be changed withini_set())What this means is you have to use an .htaccess file to do this - OR - implement a script to reverse the effects of magic quotes. Something like this