Have you tried to install Joomla 3 and then having problems inserting images in articles and pages? One reason for such a mistake, is if magic quotes is set to On in the PHP settings. In this article I will try to explain the problem and how to solve it.
Description of the problem
The problem is that when you upload images and insert them into Joomla 3 articles (or pages), the code " is added to the HTML code of the images. Actually " is added every time you insert a HTML code containing the character “, which almost all HTML contains.
Reason for the problem
The reason why this happens is that the PHP setting magic quotes is turned On. It is a setting for PHP, that was originally developed to prevent beginners of entering bad code. So some characters (“, ‘, and NULL) was replaced with a . However this setting caused more problems for users of PHP, than it solved problems. So it is removed from the future PHP version 6.
So since there is no good reason to keep magic quotes turned on, you should turn it off.
Is magic quotes turned On at my Joomla installation?
If you want to see, if magic quotes is turned On or Off on your Joomla Installation, just login to the administration backend. Then choose “System” in the top menu and then “System information”. Then finally choose the tab “PHP setting” and you will find the status of magic quotes on the list that appears. If it is set to On, that might be the reason why you have the problem.
How to solve the problem with a PHP.INI file
One way to solve the problem is to add the following line to your PHP.INI file of your root folder and your administrator folder:
magic_quotes_gpc = Off
session.save_path = “/tmp”
If you don’t already have a PHP.INI file you can create it. Unfortunately, not all hosts allow to create your own PHP.INI file and if you try, it wont work. In this case you should solve the problems in a .HTACCESS file.
How to solve the problem with a .HTACCESS file
If you cannot solve the problem with a PHP.INI file, you can solve it in a .HTACCESS file. The .HTACCESS file is placed in your root folder. If there is no .HTACCESS file, you can either create a new one or rename the file HTACCESS.txt to .HTACCESS (Not .HTACCESS.txt). Then you can add the following line:
php_flag magic_quotes_gpc 0
This should work. Check if Magic quotes is turned off, by going to PHP settings in System -> System informations -> PHP settings in backend of your Joomla installation. At the list, Magic quotes should now be turned off.
I hope this solved your problem. If not you are welcome to write a comment about your problem.




Skriv en kommentar