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:
- Open the cPanel of your hosting account:
- Go to the “Files” section and open the “File Manager”. Make sure you select the path where your Joomla site is located:
- 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.
- 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”:
- 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
- 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!
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
Solution:
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,
Tord
Hello Tord
Thanks for sharing this information.
Now you can change this settings from the cpanel, you could not do before.
Thank you.
Hi – None of the above worked for me, but here is what did:
“Steps:
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
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.
Hi, if the php.ini is in the root folder you can set it so all sub folders access it. It just depends on how the server is setup and the techs can assist you with that.
Thank you for sharing this.
I’ve tried every solution possible (written here and in other places) but only your solution worked!
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
How can modify php.ini file in “cpanel” or “direct admin”?
is there any way to modify php.ini in shared hosts?
Hello,
You should be able to by following this article: http://blog.arvixe.com/setting-custom-php-ini-files-for-your-website/
If you have a VPS or DedicatedServer, you can rebuild PHP with any configuration you’d like. On shared, simply follow the article above :).
If you have any issues, please don’t hesitate to reach out to our support team by creating a ticket.
i check this is php.ini :
magic_quotes_runtime = Off;
magic_quotes_sybase = Off;
i checked php.ini :
magic_quotes_sybase = Off;