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.
magic_quotes no longer exists in modern PHP
If you are running PHP 7.x or 8.x (which all current accounts should be), magic_quotes_gpc does not exist and cannot be enabled or disabled. The error is likely caused by old Joomla code checking for a setting that no longer applies. Update Joomla to resolve it.
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.
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:
- Log into cPanel and open Select PHP Version (or MultiPHP Manager)
- Note the version currently set for your domain
- 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 TicketFrequently 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
- magic_quotes was removed in PHP 5.4
- Update Joomla to remove the deprecated code
- Update PHP to at least 8.1
- Joomla 3 is end of life - Migrate to Joomla 4/5
- Old PHP versions are a security risk
PHP compatibility · Last updated November 2026 · Browse all PHP Scripts articles
