Categories

Featured templates

Joomla 3.x. How to turn off magic quotes

Template-help.com Team May 11, 2015
Rating: 5.0/5. From 2 votes.
Please wait...

Joomla 3.x. How to turn off magic quotes

This tutorial will show you how to turn off magic quotes in Joomla 3.x.

Joomla_3_How_to_turn_off_magic_quotes_1

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:

  1. Navigate to WAMP application > PHP (tab) > PHP settings > uncheck ‘magic quotes gps’, ‘magic quotes runtime’, ‘magic quotes sybase’;

  2. Restart WAMP’s servers:

    Joomla_3_How_to_turn_off_magic_quotes_2

If your site is on live server, there are few ways to turn of ‘magic quotes’:

The first method:

  1. 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);

  2. Then, click ‘New File’ tab to access the tool to create a new file;

  3. Create php.ini or php5.ini file;

  4. 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;

  5. Insert the following code:

    magic_quotes_gpc = Off 
  6. 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 changephp.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>
  7. 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):

    Joomla_3_How_to_turn_off_magic_quotes_3

  8. 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:

  1. Open up File Manager;

  2. Createphp.ini file;

  3. Add this code to the file and save changes:

    magic_quotes_gpc = Off
    magic_quotes_runtime = Off
    magic_quotes_sybase = Off
  4. Edit your ‘.htaccess file by adding this line to the top, save the file;

  5. Set Env PHPRC /home/youruser/public_html/php.ini;

  6. Test if the error message goes away.

The third method (works for PHP 5.3 and higher):

  1. Open File Manager;

  2. Create ‘.user.ini’ file in your Joomla root directory;

  3. 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:

Joomla 3.x. How to turn off magic quotes

Joomla Professional Templates
This entry was posted in Joomla! Tutorials and tagged joomla, magic, quotes. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket