Call Us: 512.271.5221

05
February
2014

Fixing Magic Quotes for Joomla 3.x

 

What is Magic Quotes?

At its most basic level, it is the setting within PHP that allows quotation marks to be allowed or stripped out of a string.

 

How do I tell if it is enabled/disabled?

A. You are seeing a warning message about it:

 Magic Quotes Error in Joomla

 

 

B. System info: Within Joomla you can go view your SYSTEM INFORMATION from the backend of your website.  To get to that screen:

 

j15

Go to TOOLS->SYSTEM INFO

 

j2.5-3

Go to SITE->SYSTEM INFORMATION

 

 

Click on the tab for PHP INFORMATION.

 

Do a CTRL+F and search for "magic."  You will see something that looks like:

magic3

 

 

C. If you don't have access to Joomla site, use phpinfo.php:

This is a file you upload to your FTP and then view in a browser.  Make sure you upload it to the EXACT folder you are trying to test.  To make a phpinfo.php file, open "Notepad" or another plain text editor and add this line to it:

<?php phpinfo();?>

 

Save the file as "phpinfo.php"

 

After uploading it, go to your web browser and go to that location.  For example, if you uploaded it to your /newsite/ folder and your website was example.com, then in your address bar, go to http://www.example.com/newsite/phpinfo.php

 

 

 

How to Fix It

 

A. Use cPanel php.ini EZ Config: If you have a good hosting company, then you probably have an icon in your cPanel called "php.ini EZConfig."  This is by far the easiest way to solve this problem.  

php-ez

Scroll down and make sure all Magic Quotes options are set to OFF.  Then hit SAVE CHANGES:

php-ez2

 

 

B. Adjust your php.ini file: In your FTP, find and download your php.ini file from the root folder that your Joomla site is in.  If you don't see one, you can make a new file in Notepad (or other plain text editor) and save as php.ini.  Add the following lines:

 

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

 

 

C. Adjust your .htaccess file: If you prefer to make the change to your .htaccess file, or your host does not allow you to modify your php.ini, then add these lines to your .htaccess file.

 

<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
</IfModule>

 

 

 

Troubleshooting

 

A. Check whether your site is pulling the correct php.ini: To check this, go to the SYSTEM INFO->PHP INFORMATION or PHPINFO.PHP webpage mentioned earlier in the post.  Look for the line "Loaded Configuration File."  You want this to be the php.ini you modified and uploaded.  

 

 

B. Force server to pull correct php.ini: You will need to add the following line to your .htaccess file.  To get the specific path that is correct for your site, go back to your GLOBAL CONFIGURATION->SYSTEM SETTINGS and find the "Path to Log Folder."  Take everything before the /logs and then add php.ini at the end of it.

SetEnv PHPRC /home/username/public_html/php.ini

 

 

C. Some hosting companies require you to call the file php5.ini. Godaddy is guilty of this.  If you know of others, please add in the comments.

 

D. If you are on Godaddy, you will need to restart your server.  Login to your hosting management, and go to SYSTEM PROCESSES.

 magic-gd

Then click on the icon that says END WEB.

 magic-gd2

Go back to your website and reload it.  It *should* work now.

 

 

Having a good hosting company will literally solve 75% of your Joomla problems which is why people in the Joomla forum mention it so much.  We use HostGator Hosting for all our websites and never have issues with server settings.  If you would like to switch to them, please use our affiliate link.

Author: Alexis Priddy Categories: Server Settings, .htaccess, php.ini, Hosting Companies

About the Author

Alexis Priddy

Alexis Priddy

Alexis moved to Waco in 2008 after five years in the United States Army as a military police officer.  Web design was a hobby that grew into a passionwhile she was in the military.  She is the founder of ArmyToolbag.com, a reference website for Army personnel that averages over 25,000 unique visitors a month.  When she sold that website to a national marketing firm, she decided to venture out and start YellowWebMonkey Web Design in 2009.  She has a Bachelor of Science degree in Psychology and Computer Science Engineering from the United States Military Academy at West Point, NY.

certified web designer

Get Started with YellowWebMonkey

Invalid Input

Invalid web address.

Invalid Input

Invalid Input

Joomla Certified Administrator

Joomla Maintenance Plans

Get started with reliable monthly care provided by a Joomla certified company.

Invalid Input

Invalid web address.

Invalid Input

Invalid Input

Hire YellowWebMonkey

Invalid Input

Invalid web address.

Invalid Input

Invalid Input

Joomla Certified Administrator

Learn More

Invalid Input

Invalid web address.

Invalid Input

Invalid Input

Joomla Certified Administrator

Request More Info

Invalid Input

Invalid web address.

Invalid Input

Invalid Input

Joomla Certified Administrator

Contact YellowWebMonkey

Invalid Input

Invalid web address.

Invalid Input

Invalid Input

Joomla Certified Administrator

Sign Up with YellowWebMonkey

Invalid Input

Invalid web address.

Invalid Input

Invalid Input

Joomla Certified Administrator

Same Day Estimate

Invalid Input

Invalid web address.

Invalid Input

Invalid Input

Joomla Certified Administrator

Prefer to talk on the phone?

Click to call 512-271-5221 or

Invalid Input

Invalid Input

Prefer to talk on the phone?

Click to call 512-271-5221 or

Invalid Input

Invalid Input