how to disable magic quotes

Avatar
  • Answered
Hello, I started using Joomla 3 and now have problems and was told magic quotes need to be off for it to function correctly.

Using live chat they said I could disable it per cpanel in the php.ini file. I am unable to locate this file. Cpanel docs say it's here /usr/local/lib/php.ini.

It goes on to say this- However, we strongly recommend using WHM's PHP Configuration Editor feature (Main >> Service Configuration >> PHP Configuration Editor) to edit PHP's configuration file.

You must access the Advanced Configuration Editor to change many of the settings listed below.

I guess my main question is it safe to turn it off system wide via the WHM? My php is 5.3.16 and I have no Joomla 1.5 sites only 2.5 and 3

I also have some wordpress sites but all 3.5 and above.

Also a couple other misc. scripts, dadamail, etc.

Any advise?

Thanks
Avatar
Scott
Hello DaveOzric,

I neglected to answer your main question when giving the instructions on turning off Magic_quotes on a cpanel account basis. As far as affecting 2.5, it is simply an extra layer of security, but I would try and go with the Joomla recommendations for that version. If it does not say it is mandatory or recommended, there should be no problem in turning it off system wide.

Best Regards,
Scott M
Avatar
Scott
Hello DaveOzric Your default php.ini file exists for each cPanel account in your public_html folder. To edit the magic_quotes settings, you will first want to open your cpanel, navigate to the public_html folder using the File Manager, and then edit the php.ini file. From there, look for the following lines: ; Magic quotes for incoming GET/POST/Cookie data. ;magic_quotes_gpc = On ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. magic_quotes_runtime = Off ; Use Sybase-style magic quotes (escape ' with '' instead of \'). magic_quotes_sybase = Off Ensure they are all set to Off and save the file. This will disable the magic_quotes for that domain. If you wish to use the same php.ini settings for all folders under the public_html folder, you will need to set the php.ini file to be recursive. Best Regards, Scott M