PHP Scripts

How to turn off magic quotes gpc for Joomla 3

Updated November 2026 8,728 views 3 min read
PHP Scripts | Updated November 2026

The magic_quotes_gpc setting was a PHP feature that automatically escaped quotes in user input. It was removed in PHP 5.4 (2012). If Joomla or another application is showing errors about magic quotes, the fix depends on your PHP version.

01. Joomla 3 and Magic Quotes

Joomla 3 included code that checked for magic quotes and threw warnings if it was enabled. On PHP 5.4+, calling get_magic_quotes_gpc() returns false (PHP 5.4-7.4) or causes a fatal error (PHP 8.0+) because the function was removed entirely.

To fix: update Joomla to the latest version. Joomla 3.10+ and Joomla 4/5 have removed all magic quotes references from their codebase.

02. If You Are on an Older PHP Version

If for some reason you are still running PHP 5.3 or earlier (which we strongly discourage), you can disable magic quotes in .user.ini:

magic_quotes_gpc = Off

But really, you should update your PHP version to at least 8.1. Running PHP 5.x in 2026 is a critical security risk.

Important

Joomla 3 reached end of life in August 2023. If you are still running Joomla 3, migrate to Joomla 4 or 5 as soon as possible. Unsupported CMS versions do not receive security patches and are actively targeted by attackers.

03. How to Check and Update Your PHP Version

Because this fix almost always comes down to your PHP version, confirm which one your site is running:

  1. Log into cPanel and open Select PHP Version (or MultiPHP Manager)
  2. Note the version currently set for your domain
  3. Choose PHP 8.1 or newer from the dropdown and save

If the site breaks on the newer PHP version, that is a sign the application code itself is outdated, which is the same root cause behind the magic quotes warning. Update Joomla (or whatever application is involved) to a current, supported release, then switch back to the newer PHP version. See How Do I Update or Change My PHP Version.

Need Help Updating?

Open a Support Ticket

Frequently Asked Questions

Can I turn magic_quotes_gpc off on my account?

Not on modern PHP. The setting was removed in PHP 5.4 (2012), so on PHP 7.x and 8.x it does not exist and cannot be enabled or disabled. The real fix is to update the application that is still checking for it.

If magic quotes is gone, why does Joomla still throw the error?

Old Joomla code calls get_magic_quotes_gpc(). On PHP 5.4 through 7.4 that returns false harmlessly, but on PHP 8.0 and newer the function was removed entirely, so the call causes a fatal error. Updating Joomla removes the outdated code.

How do I check which PHP version my site uses?

In cPanel open Select PHP Version (or MultiPHP Manager) and look at the version set for your domain. Current accounts should be on PHP 8.1 or newer; anything on PHP 5.x should be upgraded right away.

Is it safe to keep running Joomla 3?

No. Joomla 3 reached end of life in August 2023 and no longer receives security patches, so it is actively targeted by attackers. Migrate to Joomla 4 or 5 as soon as you can.

Quick Recap

  1. magic_quotes was removed in PHP 5.4
  2. Update Joomla to remove the deprecated code
  3. Update PHP to at least 8.1
  4. Joomla 3 is end of life - Migrate to Joomla 4/5
  5. Old PHP versions are a security risk

PHP compatibility · Last updated November 2026 · Browse all PHP Scripts articles

Share: X in Reddit f Email
  • 148 Users Found This Useful

Was this answer helpful?

Related Articles

How do I reset Zen Cart administrator password?

PHP Scripts | Updated November 2026 If you are locked out of your Zen Cart admin panel, you...

How do I reset Joomla administrator password?

PHP Scripts | Updated November 2026 If you have lost your Joomla administrator password and...

Coppermine Gallery cannot create thumbnails

PHP Scripts | Updated November 2026 If Coppermine Photo Gallery cannot create thumbnails or...

Moodle: Notice: Only variable references should be returned by reference

PHP Scripts | Updated November 2026 The "Notice: Only variable references should be returned...

Tiki Wiki: Notice: Only variable references should be returned by reference

PHP Scripts | Updated November 2026 The "Notice: Only variable references should be returned...



Save 30% on web hosting - Use coupon code Hosting30