Symptoms
- Cloning a WordPress website with the WordPress Toolkit fails with the error:
PLESK_ERROR: Fatal error: Uncaught TypeError: Cannot assign null to property mysqli_result
-
WP Toolkit Smart Update automatic updates (or a manual test run) fails during the cloning stage and generates WP-CLI search replace actions related errors in Plesk > WordPress > example.com > Logs that are similar to the following:
PLESK_ERROR: WordPress cloning from https://example.com to https://example.com failed due to the following issue: PHP Fatal error: Uncaught TypeError: Cannot assign null to property mysqli_result::$current_field of type int in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php:90 Stack trace: #0 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(90): unserialize() #1 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(57): WP_CLI\SearchReplacer->run_recursively() #2 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(582): WP_CLI\SearchReplacer->run() #3 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(400): Search_Replace_Command->php_handle_col() #4 [internal function]: Search_Replace_Command->__invoke() #5 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func() #6 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() #7 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(488): call_user_func() #8 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(436): WP_CLI\Dispatcher\Subcommand->invoke() #9 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(459): WP_CLI\Runner->run_command() #10 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1304): WP_CLI\Runner->run_command_and_exit() #11 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start() #12 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process() #13 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap() #14 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php(17): require_once('...') #15 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wpt-wp-cli.php(28): require_once('...') #16 {main} thrown in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php on line 90 Fatal error: Uncaught TypeError: Cannot assign null to property mysqli_result::$current_field of type int in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php:90 Stack trace: #0 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(90): unserialize() #1 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(57): WP_CLI\SearchReplacer->run_recursively() #2 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(582): WP_CLI\SearchReplacer->run() #3 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(400): Search_Replace_Command->php_handle_col() #4 [internal function]: Search_Replace_Command->__invoke() #5 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func() #6 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() #7 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(488): call_user_func() #8 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(436): WP_CLI\Dispatcher\Subcommand->invoke() #9 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(459): WP_CLI\Runner->run_command() #10 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1304): WP_CLI\Runner->run_command_and_exit() #11 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start() #12 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process() #13 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap() #14 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php(17): require_once('...') #15 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wpt-wp-cli.php(28): require_once('...') #16 {main} thrown in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php on line 90 Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
Cause
One of the plugins or themes installed on the site was initially configured to work with PHP 8.0 or lower and has therefore written information to the WP database that has subsequently become incompatible with the deserialization related to PHP 8.1 and above.
This causes an error within the search replace WP-CLI tool (WP_CLI/SearchReplacer.php) at the database copying stage, due to which the cloning cannot proceed as expected.
More details are available in the official bug that can be viewed on this link:
WP CLI running PHP 8.1 can't unserialize empty PHP 8.0 objects · Issue #191 · wp-cli/search-replace-command · GitHub
Resolution
Change the used PHP version for the domain to PHP version that is 8.0 or lower by following these steps:
- Log into Plesk
- Go to Domains > example.com > Dashboard > PHP
- Select PHP 8.0 or lower
- Press Save
- Run the cloning task or Smart Update via the WP Toolkit for this domain once again.
Comments
0 comments
Please sign in to leave a comment.