Log in

View Full Version : php.ini



traq
10-18-2009, 08:50 PM
trying to turn off magic quotes and it's not working. any ideas?

php.ini

magic_quotes_gpc = Off

Snookerman
10-18-2009, 10:59 PM
Are you using PHP 6? If so, that feature is disabled (http://php.net/manual/en/security.magicquotes.disabling.php).

Happy coding!

traq
10-19-2009, 02:34 AM
no, 5.2.11

(I'd be real happy if I didn't have to worry about it - so much trouble, putting user input through several scripts generates so many extra \\\\'s. And, as I'm sure you know, \\' completely defeats the purpose of escaping that ' in the first place... :()

I've already tried the .htaccess method on that page, as well. However, on the second glance, I saw this:


I have discovered that my host doesn't like either of the following directives in the .htaccess file:

php_flag magic_quotes_gpc Off
php_value magic_quotes_gpc Off

However, there is another way to disable this setting even if you don't have access to the server configuration - you can put a php.ini file in the directory where your scripts are with the directive:

magic_quotes_gpc = Off

However, these does not propogate unlike .htaccess rules, so if you launch from a sub-directory, you need the php.ini file in each directory you have as script entry points.
which seems to address my problem... But it seems excessive, having to put a php.ini file in every script directory. I'm waiting to hear back from my web host, I hope this doesn't turn out to be necessary.

the above does work, even though it's a little tedious. But I guess that's life.