Turn Off magic_quotes_gpc for Joomla

Magic Quotes is the process of escaping special characters with a ‘\’ to allow a string to be entered into a database. This is called ‘magic’ because PHP can do this automatically when magic_quotes_gpc is turned on. Joomla 3 specifically requires Magic Quotes to be off before installing it, otherwise you will not be able to install it or face issues with your images. In this article I will give you a step-by-step guide on how to turn off Magic_Quotes_GPC for Joomla.

Follow these steps:

  1. Open the cPanel of your hosting account: cpanel arvixe joomla tutorials
  2. Go to the “Files” section and open the “File Manager”. Make sure you select the path where your Joomla site is located: files section file manager cpanel joomla tutorials select web root joomla tutorials arvixe hosting
  3. Check if there is a file “php5.ini” on the web root folder of your Joomla site. If there is already a php.ini file renamed it to “php5.ini”, then go to step 5.
  4. If no “php5.ini” file is found, in the file manager, click on “New File” to create the “php5.ini” file. Enter the name of the file(php5.ini) and click on “Create New File”:  new file buttoncreating php file
  5. Open the “php5.ini” file and add the code below:
    • ; Magic quotes
      ;; Magic quotes for incoming GET/POST/Cookie data.
      magic_quotes_gpc = Off; 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
      • magic quotes off code
  6. And that’s it! Magic Quotes has been disabled!
    If you ever face this issue, apply this solution.

This concludes Turn off magic_quotes_gpc for Joomla.

Looking for quality Joomla Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , , , , , , , , , , , | Posted under Joomla | RSS 2.0

Author Spotlight

Milton Parada

I am a computer engineer, I specialize in Joomla, i am the core engineer of sw social web, I love photography.

11 Comments on Turn Off magic_quotes_gpc for Joomla

  1. Tord Dellsén says:

    Sorry but this didn’t work for me but i did find another solution.

    First my setup:
    I have joomla 3 installed in a subdomain

    What i did to solve the problem was to go into
    cpanel -> “PHP settings”
    and under “PHP.ini Creator” choose
    “Click to create PHP.ini (Placed in Home)”

    And then for “magic_quotes_gpc” change to “Off”
    (i didn’t change “magic_quotes_runtime” or anything else)
    Then i pressed “Update”

    This created a 36 KB large file called “php.ini” (not “php5.ini”) in my public_html directory (not the home directory). After this i didn’t get the error message any more. But to avoid problems for my other sites i moved the new file into the subdirectory where i have Joolma installed (in my case a directory called “joolma30” which is two levels down from “public_html”), and this still worked for me, no error message any more

    Hope this helps,

  2. Wil Gordon says:

    Hi – None of the above worked for me, but here is what did:
    Create a php.ini with the following line inside:

    magic_quotes_gpc = Off

    Put it in your Joomla 3 root (likely, /public_html/). Then change the htaccess.txt in your Joomla 3 root to .htaccess. Add the following lines to the .htaccess file (at the top) :

    suPHP_ConfigPath /home/YOURUSERNAME/public_html/

    order allow,deny
    deny from all

    Hope it helps

  3. Barry Larkin says:

    I had this problem with Joomla installed in a sub-domain, none of the solutions provided here worked. A php.ini file with magic_quotes_gpc = Off in the public_html folder had no effect, similarly the php.ini file in the joomla30 folder had no effect.

    Tech support fixed it but did not tell me the solution, I discovered with some exploration, that the php.ini file with magic_quotes_gpc = Off needs to be located in the joomla30/administrator folder this fixed the problem.
    I verified this by creating a new sub-domain and installing Joomla, until the php.ini file is placed in the joomla30/administrator folder the magic_quotes error persisted in Joomla. Having the php.ini in the public root or the joomla30 folders alone had no affect.

  4. I check all solution and one worj for me is i add this code:
    magic_quotes_gpc = Off;
    magic_quotes_runtime = Off;
    magic_quotes_sybase = Off;
    to php.ini files of administrator folder

  5. Evinic says:

    How can modify php.ini file in “cpanel” or “direct admin”?
    is there any way to modify php.ini in shared hosts?

  6. kayvan says:

    i check this is php.ini :
    magic_quotes_runtime = Off;
    magic_quotes_sybase = Off;

  7. apple id says:

    i checked php.ini :
    magic_quotes_sybase = Off;

Leave a Reply to Barry Larkin Cancel reply

Your email address will not be published. Required fields are marked *