将我的 WordPress PHP 版本升级到 8.0.25 后 script-loader.php 出现致命错误

问题描述 投票:0回答:0

我无法访问我的 WordPress,也不懂 PHP。你能帮我解决这个问题吗?

以下是我的WordPress目录的样子

/ohayotourism.com/public_html/newyork

“ohayotourism.com”和“ohayotourism.com/newyork”都安装了 WordPress。

这个周末我遇到了 500 错误,这使我无法访问这两个页面。在发现问题与服务器空间(太低)有关之前,我将我的 PHP 版本升级到 8.0.25,并删除了一些旧备份,这有助于恢复对 ohayotourism.com 的访问,但不能访问“/newyork”。当我尝试访问它时,我看到以下消息:

This page isn’t working
ohayotourism.com is currently unable to handle this request.
HTTP ERROR 500

如果我降级 PHP,我会恢复对“ohayotourism.com/newyork”的访问权限,但会失去对所有站点上的 wp-admin 的访问权限。所以我检查了错误日志并注意到一些致命错误如下:

[Sun May 14 03:02:24.330258 2023] [fcgid:warn] [pid 1031:tid 1566] [client 172.68.118.92:33226] mod_fcgid: stderr: PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in /home/makiro0421/ohayotourism.com/public_html/newyork/wp-includes/script-loader.php on line 707, referer: https://ohayotourism.com/disney-viptour/
[Sun May 14 03:02:28.178050 2023] [fcgid:warn] [pid 1031:tid 1561] [client 162.158.158.119:33192] mod_fcgid: stderr: PHP Warning:  Undefined array key "Twitter" in /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
[Sun May 14 03:02:28.178078 2023] [fcgid:warn] [pid 1031:tid 1561] [client 162.158.158.119:33192] mod_fcgid: stderr: PHP Warning:  Undefined array key "Twitter" in /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
[Sun May 14 03:02:46.305103 2023] [fcgid:warn] [pid 1030:tid 1243] [client 172.70.233.39:33998] mod_fcgid: stderr: PHP Warning:  Undefined array key "Twitter" in /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897, referer: https://www.google.co.jp/
[Sun May 14 03:02:46.305153 2023] [fcgid:warn] [pid 1030:tid 1243] [client 172.70.233.39:33998] mod_fcgid: stderr: PHP Warning:  Undefined array key "Twitter" in /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897, referer: https://www.google.co.jp/
[Sun May 14 03:02:55.205608 2023] [fcgid:warn] [pid 1029:tid 1090] (104)Connection reset by peer: [client 141.101.86.40:34494] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:02:56.844944 2023] [fcgid:warn] [pid 1031:tid 1520] (104)Connection reset by peer: [client 172.70.223.16:34572] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:02:58.272918 2023] [fcgid:warn] [pid 1031:tid 1533] (104)Connection reset by peer: [client 162.158.119.35:34626] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:02:59.854620 2023] [fcgid:warn] [pid 1031:tid 1554] (104)Connection reset by peer: [client 141.101.86.61:34734] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:01.221594 2023] [fcgid:warn] [pid 1031:tid 1537] (104)Connection reset by peer: [client 172.70.233.36:34802] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:02.781334 2023] [fcgid:warn] [pid 1029:tid 1094] (104)Connection reset by peer: [client 172.70.122.151:34874] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:03.008162 2023] [fcgid:warn] [pid 1031:tid 1557] [client 172.70.35.93:35002] mod_fcgid: stderr: PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in /home/makiro0421/ohayotourism.com/public_html/newyork/wp-includes/script-loader.php on line 707
[Sun May 14 03:03:04.331352 2023] [fcgid:warn] [pid 1030:tid 1257] (104)Connection reset by peer: [client 172.70.223.15:34954] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:06.131367 2023] [fcgid:warn] [pid 1031:tid 1562] (104)Connection reset by peer: [client 172.70.233.9:35082] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:07.400502 2023] [fcgid:warn] [pid 1031:tid 1564] (104)Connection reset by peer: [client 172.68.118.92:35152] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:08.794642 2023] [fcgid:warn] [pid 1032:tid 1424] (104)Connection reset by peer: [client 162.158.5.245:35252] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:10.386239 2023] [fcgid:warn] [pid 1031:tid 1570] (104)Connection reset by peer: [client 141.101.86.91:35334] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:11.828628 2023] [fcgid:warn] [pid 1032:tid 1428] (104)Connection reset by peer: [client 141.101.86.91:35404] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:13.329372 2023] [fcgid:warn] [pid 1031:tid 1568] (104)Connection reset by peer: [client 162.158.118.234:35502] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:14.800674 2023] [fcgid:warn] [pid 1031:tid 1588] (104)Connection reset by peer: [client 172.70.122.88:35602] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun May 14 03:03:18.437052 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Object of class CurlHandle could not be converted to string in /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/includes/class-scc-http.php:112
[Sun May 14 03:03:18.437089 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: Stack trace:
[Sun May 14 03:03:18.437093 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #0 /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/includes/class-scc-share-crawler.php(209): SCC_HTTP::multi_remote_request(Array, Array, Array, Array, 10, true, true)
[Sun May 14 03:03:18.437096 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #1 /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/includes/class-scc-share-cache-engine.php(361): SCC_Share_Crawler->get_data(Array, NULL)
[Sun May 14 03:03:18.437100 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #2 /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/includes/class-scc-share-cache-engine.php(101): SCC_Share_Cache_Engine->get_data(Array, Array)
[Sun May 14 03:03:18.437103 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #3 /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/includes/class-scc-share-rush-cache-engine.php(308): SCC_Share_Cache_Engine->cache(Array)
[Sun May 14 03:03:18.437107 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #4 /home/makiro0421/ohayotourism.com/public_html/wp-includes/class-wp-hook.php(308): SCC_Share_Rush_Cache_Engine->execute_cache(0, 'IzKTEIY')
[Sun May 14 03:03:18.437110 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #5 /home/makiro0421/ohayotourism.com/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
[Sun May 14 03:03:18.437113 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #6 /home/makiro0421/ohayotourism.com/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
[Sun May 14 03:03:18.437116 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #7 /home/makiro0421/ohayotourism.com/public_html/wp-cron.php(188): do_action_ref_array('scc_share_rushc...', Array)
[Sun May 14 03:03:18.437119 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr: #8 {main}
[Sun May 14 03:03:18.437131 2023] [fcgid:warn] [pid 1029:tid 1107] [client 172.68.119.37:35890] mod_fcgid: stderr:   thrown in /home/makiro0421/ohayotourism.com/public_html/wp-content/plugins/sns-count-cache/includes/class-scc-http.php on line 112

日志还在继续,但我希望这个示例有助于找到问题的根源。

以下是第707行附近的script-loader.php的样子:

/**
 * Adds inline scripts required for the TinyMCE in the block editor.
 *
 * These TinyMCE init settings are used to extend and override the default settings
 * from `_WP_Editors::default_settings()` for the Classic block.
 *
 * @since 5.0.0
 *
 * @global WP_Scripts $wp_scripts
 */
function wp_tinymce_inline_scripts() {
    global $wp_scripts;

    /** This filter is documented in wp-includes/class-wp-editor.php */
    $editor_settings = apply_filters( 'wp_editor_settings', array( 'tinymce' => true ), 'classic-block' );

    $tinymce_plugins = array(
        'charmap',
        'colorpicker',
        'hr',
        'lists',
        'media',
        'paste',
        'tabfocus',
        'textcolor',
        'fullscreen',
        'wordpress',
        'wpautoresize',
        'wpeditimage',
        'wpemoji',
        'wpgallery',
        'wplink',
        'wpdialogs',
        'wptextpattern',
        'wpview',
    );

    /* This filter is documented in wp-includes/class-wp-editor.php */
    $tinymce_plugins = apply_filters( 'tiny_mce_plugins', $tinymce_plugins, 'classic-block' );
    $tinymce_plugins = array_unique( $tinymce_plugins );

    $disable_captions = false;
    // Runs after `tiny_mce_plugins` but before `mce_buttons`.
    /** This filter is documented in wp-admin/includes/media.php */
    if ( apply_filters( 'disable_captions', '' ) ) {
        $disable_captions = true;
    }

    $toolbar1 = array(
        'formatselect',
        'bold',
        'italic',
        'bullist',
        'numlist',
        'blockquote',
        'alignleft',
        'aligncenter',
        'alignright',
        'link',
        'unlink',
        'wp_more',
        'spellchecker',
        'wp_add_media',
        'wp_adv',
    );

    /* This filter is documented in wp-includes/class-wp-editor.php */
    $toolbar1 = apply_filters( 'mce_buttons', $toolbar1, 'classic-block' );

    $toolbar2 = array(
        'strikethrough',
        'hr',
        'forecolor',
        'pastetext',
        'removeformat',
        'charmap',
        'outdent',
        'indent',
        'undo',
        'redo',
        'wp_help',
    );

    /* This filter is documented in wp-includes/class-wp-editor.php */
    $toolbar2 = apply_filters( 'mce_buttons_2', $toolbar2, 'classic-block' );
    /* This filter is documented in wp-includes/class-wp-editor.php */
    $toolbar3 = apply_filters( 'mce_buttons_3', array(), 'classic-block' );
    /* This filter is documented in wp-includes/class-wp-editor.php */
    $toolbar4 = apply_filters( 'mce_buttons_4', array(), 'classic-block' );
    /* This filter is documented in wp-includes/class-wp-editor.php */
    $external_plugins = apply_filters( 'mce_external_plugins', array(), 'classic-block' );

    $tinymce_settings = array(
        'plugins'  => implode( ',', $tinymce_plugins ),
        'toolbar1' => implode( ',', $toolbar1 ),
        'toolbar2' => implode( ',', $toolbar2 ),
        'toolbar3' => implode( ',', $toolbar3 ),
        'toolbar4' => implode( ',', $toolbar4 ),
        'external_plugins' => wp_json_encode( $external_plugins ),
        'classic_block_editor' => true,
    );

    if ( $disable_captions ) {
        $tinymce_settings['wpeditimage_disable_captions'] = true;
    }

    if ( ! empty( $editor_settings['tinymce'] ) && is_array( $editor_settings['tinymce'] ) ) {
        array_merge( $tinymce_settings, $editor_settings['tinymce'] );
    }

    /* This filter is documented in wp-includes/class-wp-editor.php */
    $tinymce_settings = apply_filters( 'tiny_mce_before_init', $tinymce_settings, 'classic-block' );

    // Do "by hand" translation from PHP array to js object.
    // Prevents breakage in some custom settings.
    $init_obj = '';
    foreach ( $tinymce_settings as $key => $value ) {
        if ( is_bool( $value ) ) {
            $val = $value ? 'true' : 'false';
            $init_obj .= $key . ':' . $val . ',';
            continue;
        } elseif ( ! empty( $value ) && is_string( $value ) && (
            ( '{' == $value{0} && '}' == $value{strlen( $value ) - 1} ) ||
            ( '[' == $value{0} && ']' == $value{strlen( $value ) - 1} ) ||
            preg_match( '/^\(?function ?\(/', $value ) ) ) {
            $init_obj .= $key . ':' . $value . ',';
            continue;
        }
        $init_obj .= $key . ':"' . $value . '",';
    }

    $init_obj = '{' . trim( $init_obj, ' ,' ) . '}';

    $script = 'window.wpEditorL10n = {
        tinymce: {
            baseURL: ' . wp_json_encode( includes_url( 'js/tinymce' ) ) . ',
            suffix: ' . ( SCRIPT_DEBUG ? '""' : '".min"' ) . ',
            settings: ' . $init_obj . ',
        }
    }';

    $wp_scripts->add_inline_script( 'wp-block-library', $script, 'before' );
}

如果您需要更多信息,请告诉我。提前致谢。

php wordpress error-handling http-status-code-500
© www.soinside.com 2019 - 2024. All rights reserved.