Back to Community

Understanding and Resolving PHP Compatibility Warnings in Duplicator

12 threads Sep 10, 2025 PluginDuplicator

Content

Many users of the Duplicator plugin encounter PHP warnings and errors when running compatibility checkers or updating their server's PHP version. These messages can be alarming, but they often don't indicate a critical failure. This guide explains the most common warnings and what they mean for your site's functionality.

Common PHP Compatibility Warnings in Duplicator

Based on community reports, the most frequent warnings fall into a few specific categories:

  • Deprecated MySQL Functions: Warnings about the use of mysql_ functions, which were deprecated in PHP 5.5 and removed in PHP 7.0.
  • Curly Brace Syntax Deprecation: Errors stating "Array and string offset access syntax with curly braces is no longer supported", particularly in files like installer.php or lib/forceutf8/Encoding.php. This syntax was deprecated in PHP 7.4 and removed in later versions.
  • Deprecated INI Directives: Warnings about the safe_mode INI directive, which was deprecated in PHP 5.3 and completely removed in PHP 5.4.
  • Return Type Compatibility: In PHP 8.2+, warnings about iterator methods lacking return type declarations that are compatible with the Iterator interface.
  • Third-Party Library Issues: Notices about deprecated files, such as class-oembed.php, within Duplicator's bundled libraries.

Why These Warnings Appear

The Duplicator plugin is designed to support a very wide range of hosting environments, including older PHP versions. To maintain this backward compatibility, the plugin's codebase may contain legacy code or use functions that are deprecated in newer PHP versions. A PHP compatibility checker will flag this code, even if it is conditionally executed only on older PHP installations where it is still valid.

For example, code checking for the long-removed safe_mode setting is likely part of an old environment detection routine that doesn't run on modern PHP versions. Similarly, the deprecated MySQL functions are likely contained within a fallback path for systems that do not have the modern MySQLi extension available.

Should You Be Concerned?

In most cases, these warnings are non-critical. The plugin often includes conditional logic to use modern functions when available. Many users report that Duplicator continues to function correctly on PHP 7.4, 8.0, and 8.1 despite these warnings appearing in logs or scanner reports.

The exception is the curly brace syntax deprecation. If this code is executed on PHP 8.1 or higher, it will cause a fatal error and halt the process. This is most critical in the installer.php script during a restoration or migration, as seen in Thread 1.

Recommended Solutions and Workarounds

  1. For Fatal Errors (Especially in installer.php): If you encounter a fatal error during a migration, your immediate solution is to temporarily lower your server's PHP version to 7.4 to complete the restoration process. Afterwards, you can upgrade again. The Duplicator team has historically addressed these critical fatal errors in updates, so ensuring you are using the latest version is crucial.
  2. For Non-Critical Warnings: If the plugin is functioning and you are only seeing warnings in a scanner or debug log, you can often safely ignore them. They are typically remnants of legacy support and do not impact functionality on modern servers.
  3. Keep Duplicator Updated: The Duplicator team actively works on compatibility. Updates frequently resolve the most pressing compatibility issues, such as replacing curly brace syntax with square brackets ([]) in the Encoding.php file, a fix mentioned in several threads.
  4. Test in a Staging Environment: Before updating the PHP version on your live site, always test the entire process—especially a Duplicator migration—on a staging site running the target PHP version. This is the best way to uncover any true incompatibilities.

Remember, while compatibility checkers are useful tools, they can sometimes report false positives for plugins that maintain broad backward compatibility. The true test is whether the plugin operates without causing fatal errors on your specific server configuration.