After the WordPress system disk is redeployed (PHP 7.4 upgrade to PHP 8.1), prompt: This site encountered a fatal error.

在 WordPress 的系统盘重新部署后,提示:此站点遇到了致命错误。
1. Reference:In Alibaba Cloud ECS, CentOS 7 migration (replace) to Alibaba Cloud Linux 3 . After the WordPress system disk is redeployed, it prompts: This site encountered a fatal error. as shown in Figure 1
在 WordPress 的系统盘重新部署后,提示:此站点遇到了致命错误。
Figure 1
2. Learn more about troubleshooting WordPress. Enable developer-only: WordPress debug mode. Edit wp-config.php


/**
 * 开发者专用:WordPress 调试模式。
 *
 * 将这个值改为“true”,WordPress 将显示所有用于开发的提示。
 * 强烈建议插件开发者在开发环境中启用本功能。
 */
define('WP_DEBUG', true);


3. Refresh the page again, report an error


Deprecated: Return type of HMBackUpWordPressCleanUpIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /data/wwwroot/www.shuijingwanwq.com/wp-content/plugins/backupwordpress/classes/class-path.php on line 456

Fatal error: Uncaught Error: Undefined constant "wp_cumulus_widget" in /data/wwwroot/www.shuijingwanwq.com/wp-content/plugins/wp-cumulus/wp-cumulus.php:375 Stack trace: #0 /data/wwwroot/www.shuijingwanwq.com/wp-includes/class-wp-hook.php(308): widget_init_wp_cumulus_widget() #1 /data/wwwroot/www.shuijingwanwq.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #2 /data/wwwroot/www.shuijingwanwq.com/wp-includes/plugin.php(517): WP_Hook->do_action() #3 /data/wwwroot/www.shuijingwanwq.com/wp-includes/widgets.php(1854): do_action() #4 /data/wwwroot/www.shuijingwanwq.com/wp-includes/class-wp-hook.php(308): wp_widgets_init() #5 /data/wwwroot/www.shuijingwanwq.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #6 /data/wwwroot/www.shuijingwanwq.com/wp-includes/plugin.php(517): WP_Hook->do_action() #7 /data/wwwroot/www.shuijingwanwq.com/wp-settings.php(623): do_action() #8 /data/wwwroot/www.shuijingwanwq.com/wp-config.php(87): require_once('...') #9 /data/wwwroot/www.shuijingwanwq.com/wp-load.php(50): require_once('...') #10 /data/wwwroot/www.shuijingwanwq.com/wp-blog-header.php(13): require_once('...') #11 /data/wwwroot/www.shuijingwanwq.com/index.php(17): require('...') #12 {main} thrown in /data/wwwroot/www.shuijingwanwq.com/wp-content/plugins/wp-cumulus/wp-cumulus.php on line 375


4. If it is found that they are all errors of the plugin, I decided to find a way to disable the plug-in that reports the error. Due to the WordPress dashboard, you need to disable plugins in different ways. Reference:How to Disable WordPress Plugin (4 Ways). 5. Reference:How to Disable WordPress Plugin via phpMyAdmin . Its essence is to operate data in the database. 6. Back up the database first, and then operate the data. Open the table wp_options, as shown in Figure 2
先备份数据库,再操作数据。打开表 wp_options
Figure 2
7. In the Options table, look for the active_plugins entry in the option_name column. Execute the following query SQL. as shown in Figure 3
在选项表中,在 option_name 列中查找 active_plugins 条目。执行以下查询 SQL
Figure 3


SELECT * FROM `wp_options` WHERE `option_name` = 'active_plugins'


8. Copy the value of the column OPTION_VALUE in the query result record, and use the PHP online deserialization tool.



a:14:{i:0;s:53:"accelerated-mobile-pages/accelerated-moblie-pages.php";i:1;s:19:"akismet/akismet.php";i:2;s:35:"backupwordpress/backupwordpress.php";i:3;s:33:"classic-editor/classic-editor.php";i:4;s:36:"contact-form-7/wp-contact-form-7.php";i:5;s:45:"disable-google-fonts/disable-google-fonts.php";i:6;s:72:"golang-brush-for-syntaxhighlighter-evolved/syntaxhighlighter-GoBrush.php";i:7;s:25:"hueman-addons/ha-fire.php";i:8;s:15:"light/light.php";i:9;s:33:"nimble-builder/nimble-builder.php";i:10;s:47:"regenerate-thumbnails/regenerate-thumbnails.php";i:11;s:39:"syntaxhighlighter/syntaxhighlighter.php";i:12;s:25:"wp-cumulus/wp-cumulus.php";i:13;s:27:"wp-pagenavi/wp-pagenavi.php";}


Array
(
    [0] => accelerated-mobile-pages/accelerated-moblie-pages.php
    [1] => akismet/akismet.php
    [2] => backupwordpress/backupwordpress.php
    [3] => classic-editor/classic-editor.php
    [4] => contact-form-7/wp-contact-form-7.php
    [5] => disable-google-fonts/disable-google-fonts.php
    [6] => golang-brush-for-syntaxhighlighter-evolved/syntaxhighlighter-GoBrush.php
    [7] => hueman-addons/ha-fire.php
    [8] => light/light.php
    [9] => nimble-builder/nimble-builder.php
    [10] => regenerate-thumbnails/regenerate-thumbnails.php
    [11] => syntaxhighlighter/syntaxhighlighter.php
    [12] => wp-cumulus/wp-cumulus.php
    [13] => wp-pagenavi/wp-pagenavi.php
)


9. Remove the plugin in the result of deserialization: backupwordpress/backupwordpress.php, wp-cumulus/wp-cumulus.php, and then php The serialized result is stored in the value of the column Option_VALUE. The PHP code is implemented as follows


<?php
$a = 'a:14:{i:0;s:53:"accelerated-mobile-pages/accelerated-moblie-pages.php";i:1;s:19:"akismet/akismet.php";i:2;s:35:"backupwordpress/backupwordpress.php";i:3;s:33:"classic-editor/classic-editor.php";i:4;s:36:"contact-form-7/wp-contact-form-7.php";i:5;s:45:"disable-google-fonts/disable-google-fonts.php";i:6;s:72:"golang-brush-for-syntaxhighlighter-evolved/syntaxhighlighter-GoBrush.php";i:7;s:25:"hueman-addons/ha-fire.php";i:8;s:15:"light/light.php";i:9;s:33:"nimble-builder/nimble-builder.php";i:10;s:47:"regenerate-thumbnails/regenerate-thumbnails.php";i:11;s:39:"syntaxhighlighter/syntaxhighlighter.php";i:12;s:25:"wp-cumulus/wp-cumulus.php";i:13;s:27:"wp-pagenavi/wp-pagenavi.php";}';
$b = unserialize($a);
print_r($b);
$c = [
    'accelerated-mobile-pages/accelerated-moblie-pages.php',
    'akismet/akismet.php',
    'classic-editor/classic-editor.php',
    'contact-form-7/wp-contact-form-7.php',
    'disable-google-fonts/disable-google-fonts.php',
    'golang-brush-for-syntaxhighlighter-evolved/syntaxhighlighter-GoBrush.php',
    'hueman-addons/ha-fire.php',
    'light/light.php',
    'nimble-builder/nimble-builder.php',
    'regenerate-thumbnails/regenerate-thumbnails.php',
    'syntaxhighlighter/syntaxhighlighter.php',
    'wp-pagenavi/wp-pagenavi.php'
];
print_r($c);
$d = serialize($c);
print_r($d);
exit;
?>





Array
(
    [0] =&gt; accelerated-mobile-pages/accelerated-moblie-pages.php
    [1] =&gt; akismet/akismet.php
    [2] =&gt; classic-editor/classic-editor.php
    [3] =&gt; contact-form-7/wp-contact-form-7.php
    [4] =&gt; disable-google-fonts/disable-google-fonts.php
    [5] =&gt; golang-brush-for-syntaxhighlighter-evolved/syntaxhighlighter-GoBrush.php
    [6] =&gt; hueman-addons/ha-fire.php
    [7] =&gt; light/light.php
    [8] =&gt; nimble-builder/nimble-builder.php
    [9] =&gt; regenerate-thumbnails/regenerate-thumbnails.php
    [10] =&gt; syntaxhighlighter/syntaxhighlighter.php
    [11] =&gt; wp-pagenavi/wp-pagenavi.php
)

a:12:{i:0;s:53:&quot;accelerated-mobile-pages/accelerated-moblie-pages.php&quot;;i:1;s:19:&quot;akismet/akismet.php&quot;;i:2;s:33:&quot;classic-editor/classic-editor.php&quot;;i:3;s:36:&quot;contact-form-7/wp-contact-form-7.php&quot;;i:4;s:45:&quot;disable-google-fonts/disable-google-fonts.php&quot;;i:5;s:72:&quot;golang-brush-for-syntaxhighlighter-evolved/syntaxhighlighter-GoBrush.php&quot;;i:6;s:25:&quot;hueman-addons/ha-fire.php&quot;;i:7;s:15:&quot;light/light.php&quot;;i:8;s:33:&quot;nimble-builder/nimble-builder.php&quot;;i:9;s:47:&quot;regenerate-thumbnails/regenerate-thumbnails.php&quot;;i:10;s:39:&quot;syntaxhighlighter/syntaxhighlighter.php&quot;;i:11;s:27:&quot;wp-pagenavi/wp-pagenavi.php&quot;;}




UPDATE `shuijingwanwq`.`wp_options` SET `option_value`='a:12:{i:0;s:53:"accelerated-mobile-pages/accelerated-moblie-pages.php";i:1;s:19:"akismet/akismet.php";i:2;s:33:"classic-editor/classic-editor.php";i:3;s:36:"contact-form-7/wp-contact-form-7.php";i:4;s:45:"disable-google-fonts/disable-google-fonts.php";i:5;s:72:"golang-brush-for-syntaxhighlighter-evolved/syntaxhighlighter-GoBrush.php";i:6;s:25:"hueman-addons/ha-fire.php";i:7;s:15:"light/light.php";i:8;s:33:"nimble-builder/nimble-builder.php";i:9;s:47:"regenerate-thumbnails/regenerate-thumbnails.php";i:10;s:39:"syntaxhighlighter/syntaxhighlighter.php";i:11;s:27:"wp-pagenavi/wp-pagenavi.php";}' WHERE `option_id`=35;


10. After restoring the changes in step 2, refresh the page again, and the display is normal.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.