- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Joomla 3.x. How to turn off magic quotes
May 11, 2015
Joomla 3.x. How to turn off magic quotes
This tutorial will show you how to turn off magic quotes in Joomla 3.x.
Magic Quotes was a PHP feature, enabled using the magic_quotes_gpc setting, that escaped (in a very limited way) most of the input data accessible to PHP scripts.
This PHP feature has been deprecated as of PHP 5.3.0 and has been removed from PHP as of PHP 5.4.0.
Joomla! 3.0 and above requires magic_quotes_gpc to be set to off and will not install if magic_quotes_gpc is on.
If you are using WAMP (local server software), follow the steps below:
-
Navigate to WAMP application > PHP (tab) > PHP settings > uncheck ‘magic quotes gps’, ‘magic quotes runtime’, ‘magic quotes sybase’;
-
Restart WAMP’s servers:
If your site is on live server, there are few ways to turn of ‘magic quotes’:
The first method:
-
Open File Manager through your control panel (SiteAdmin or cPanel) and ensure you are in the public_html (www) directory (also ensure that "hidden files" are visible);
-
Then, click ‘New File’ tab to access the tool to create a new file;
-
Create php.ini or php5.ini file;
-
Click ‘Edit’ link at the top of the page or with a right mouse click. This will open the file editor so you can input your custom configuration settings;
-
Insert the following code:
magic_quotes_gpc = Off
-
Make the php.ini recursive in the .htaccess file. Change the file ‘htaccess.txt’ in your Joomla 3 root to ‘.htaccess’. Add the following lines to the ‘.htaccess’ file (at the top), don’t forget to change ‘php.ini’ to ‘php5.ini’ when applicable :
<IfModule mod_suphp.c> suPHP_ConfigPath /home/myusername/public_html/yourJ3folder <Files php.ini> order allow,deny deny from all </Files> </IfModule>
-
Change ‘myusername’ and ‘yourJ3folder’ to your respective folders. The ‘/home/myusername/public_html/yourJ3folder’ can be found via the Global Configuration:
In Joomla backend > System > System Information > [Directory Permissions], the folder is usually the same as the log directory (but without /logs at the end):
-
For some hosts, add the following code to the ‘.htaccess’ file in the root of your site (for example /home/myusername/public_html/.htaccess):
php_flag magic_quotes_gpc off
The second method:
-
Open up File Manager;
-
Create ‘php.ini’ file;
-
Add this code to the file and save changes:
magic_quotes_gpc = Off magic_quotes_runtime = Off magic_quotes_sybase = Off
-
Edit your ‘.htaccess’ file by adding this line to the top, save the file;
-
Set Env PHPRC /home/youruser/public_html/php.ini;
-
Test if the error message goes away.
The third method (works for PHP 5.3 and higher):
-
Open File Manager;
-
Create ‘.user.ini’ file in your Joomla root directory;
-
Add this code to the file and save changes:
magic_quotes_gpc = Off
In case you have any difficulties, it is strongly recommended that you contact your hosting provider.
Feel free to check the detailed video tutorial below: