Jump to content

[SOLVED] Howto: Disable/Turn off magic quotes with apache2 (linux)


zlgo

Recommended Posts

Hi all,

I just wanted to make it clear on how to get rid of magic quotes on your server forever! Because i know how annoying it is for developers having to get rid of all those backslashes and knowing the risk of mysql injection.

 

How to Do it

Simple! All you have to do is find a file called php.ini on you server somewhere (my ubuntu server's php.ini was "/etc/php5/apache2/php.ini") and edit it.

So first open a terminal.

Then (for ubuntu users) type "sudo nano " and then the location of the php.ini (e.g. /etc/php5/apache2/php.ini )

 

For other linux systems like gentoo or SuSe use you need to type:

"su"

press enter (type your password when it asks) and then:

"nano" and then the location of the php.ini like above.

 

Now you need to change a certain text, but this php.ini file is pretty big so you need to press CTRL+W and then type "magic" and press enter. You appear in the section labelled "Magic Quotes". Now there should be some text that says "magic_quotes_gpc = On". This needs to be changed if you want magic quotes off. So you simply change "On" to "Off" (Keep it case sensitive). Now press CTRL+X, type y and press enter. If that went ok then all you have to do now is reboot so when php reloads itself it will find that magic quotes are now turned off and you never have to worry about them again!

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.