Fix removed get_magic_quotes_gpc in PHP 8
Call to undefined function get_magic_quotes_gpc() points to code attempting to use a removed PHP function.
Which PHP version does your site report?
We read only what your site already sends in public: the headers and the top of the homepage. No scan, no login.
Before you start
Save the complete error line and its timestamp in a private note. Record the action that failed, the current PHP version and any components updated at the same time. Share only information needed for the investigation.
Public support forums are not suitable places for customer details, access credentials or complete server paths.
Back up both files and the database before making changes. Check that the backup is usable. Work on a restricted test copy with the same PHP version and relevant settings.
Disable real payments and outgoing customer emails there. Agree who will make the change and who will check the result. These steps are an investigation guide, not a diagnosis of your particular website.
Causes and the PHP update
PHP removed get_magic_quotes_gpc in version 8.0 after deprecating it in 7.4. The function belonged to the old magic-quotes approach. A remaining check may sit in a bundled library or custom form code.
A file inside a theme does not prove that the theme author originally wrote it. Ask the component maintainer to identify the bundled library and its supported replacement.
Choosing the correct repair
Do not introduce a homemade function with the removed name as a general repair. Investigate what the surrounding code does to input after checking the setting. Adding or removing slashes without that context can damage text.
Ask the maintainer to remove the obsolete branch while preserving the current input flow. Do not rewrite all stored text to fix a single failed call.
Five steps to a repair
- Locate the exact call and affected file in the private log. Record which form or import reproduces the failure on the test copy.
- Identify the plugin, theme or library supplying that file. Check whether a maintained release has already removed the legacy magic-quotes check.
- Update the responsible component on the test copy. For custom code, review the check and its associated text processing together rather than merely replacing a function name.
- Test new input containing apostrophes, quotation marks and ordinary text. Compare what you enter, what is stored and what appears when the entry is reopened.
- Also inspect existing content without rewriting it. Repeat the original action and keep the test result, fresh logs and the chosen component version.
A practical check
A suitable test is a contact form with an apostrophe in a fictional business name. Add a comment containing quotation marks and reopen the saved request. The displayed text should match the intended input.
Use fictional data throughout this test. Include an existing test request so that a repair to new submissions does not silently change how older content is displayed. This is a functional acceptance check, not a security test or proof about the safety of the entire form.
Getting help and checking the repair
Use the help form below if you cannot access the logs or do not know who maintains the affected code. Describe one failed action and the expected result. Ask for a proposal that separates the cause, the change and the acceptance check.
Do not include passwords with your request.
After the repair, repeat the original action on the test copy. Also check a normal visitor journey, an empty result and invalid input where relevant. Review fresh log entries at the new test time.
Keep versions and outcomes in your maintenance notes. Let the responsible administrator decide when the tested change can be applied to the live website.
Choosing the next step
Use the links below this article to choose the next step. The PHP update page helps you discuss maintenance with the administrator. Use the Exposure Check to check your PHP version.
A public check may not identify a version; confirm it with your host when necessary. Do not treat its result as evidence that this programming error is repaired. Use the status page for current security information.
Keep the repair of the visitor action and the assessment of the server as separate checks in your notes. When requesting help, include the error text, the failed action and the expected result, but no passwords. Ask for one responsible person to oversee both the change and its acceptance.