我刚刚安装了 Xampp 并下载了最近的 Wordpress。我尝试更改任何主题,但出现以下错误
I just installed Xampp and downloaded the recent Wordpress. I tried changing any theme but I get the error below
致命错误:未捕获的 ArgumentCountError:array_merge() 不接受 C:\xampp\htdocs\wp-includes\widgets.php:1265 中的未知命名参数:#0 C:\xampp\htdocs\wp-includes\widgets.php(1265): array_merge(wp_inactive_widgets: 数组, sidebar-1: 数组) #1 C:\xampp\htdocs\wp-includes\widgets.php(1220) : retrieve_widgets(真) #2 C:\xampp\htdocs\wp-includes\class-wp-hook.php(289): _wp_sidebars_changed('Twenty Twenty') #3 C:\xampp\htdocs\wp-includes\class-wp-hook. php(311): WP_Hook->apply_filters(NULL, 数组) #4 C:\xampp\htdocs\wp-includes\plugin.php(478): WP_Hook-> do_action(数组)#5 C:\xampp\htdocs\wp-includes\theme.php(3267): do_action('after_switch_th...', 'Twenty Twenty', 对象(WP_Theme)) #6 C:\xampp\htdocs\wp-includes\class-wp-hook.php(287): check_theme_switched('') #7 C:\xampp\htdocs\wp-includes\class-wp-hook.php(311) : WP_Hook->apply_filters(NULL, 数组) #8 C:\xampp\htdocs\wp-includes\plugin.php(478): WP_Hook->do_action(数组) #9 C:\xampp\htdocs\wp-settings.php(546): do_action('init') #10 C:\xampp\htdocs\wp-config.php(90): require_once('C:\xampp\htdocs...') #11 C:\xampp\htdocs\wp-load.php(37): require_once('C:\xampp\htdocs...') #12 C:\xampp\htdocs\wp-blog-header.php(13): require_once('C:\xampp\htdocs...') #13 C:\xampp\htdocs\index.php(17): 要求('C:\xampp\htdocs...' ) #14 {main} throw in C:\xampp\htdocs\wp-includes\widgets.php on line 1265
有同样的问题。
谷歌搜索显示,在过去的几天里,许多其他人也遇到了同样的问题。
问题似乎是 WordPress 与 XAMPP 附带的新 PHP 8.0.0 版本不兼容。
目前的解决方案是卸载 XAMPP 并下载一个旧版本 (PHP 7.4.13)。可以在这里上车:https://www.apachefriends.org/xampp-files/7.4.13/xampp-windows-x64-7.4.13-0-VC15-installer.exe
来源:https://make.wordpress.org/core/2020/11/23/wordpress-and-php-8-0/
https://wordpress.org/support/topic/error-on-setting-up-any-theme/
致命错误:未捕获的 ArgumentCountError:array_merge() 不接受 C:\xampp\htdocs\wp-includes\widgets.php:1265 中的未知命名参数:#0 C:\xampp\htdocs\wp-includes\widgets.php(1265): array_merge(wp_inactive_widgets: 数组, sidebar-1: 数组) #1 C:\xampp\htdocs\wp-includes\widgets.php(1220) : retrieve_widgets(真) #2 C:\xampp\htdocs\wp-includes\class-wp-hook.php(289): _wp_sidebars_changed('Twenty Twenty') #3 C:\xampp\htdocs\wp-includes\class-wp-hook. php(311): WP_Hook->apply_filters(NULL, 数组) #4 C:\xampp\htdocs\wp-includes\plugin.php(478): WP_Hook-> do_action(数组)#5 C:\xampp\htdocs\wp-includes\theme.php(3267): do_action('after_switch_th...', 'Twenty Twenty', 对象(WP_Theme)) #6 C:\xampp\htdocs\wp-includes\class-wp-hook.php(287): check_theme_switched('') #7 C:\xampp\htdocs\wp-includes\class-wp-hook.php(311) : WP_Hook->apply_filters(NULL, 数组) #8 C:\xampp\htdocs\wp-includes\plugin.php(478): WP_Hook->do_action(数组) #9 C:\xampp\htdocs\wp-settings.php(546): do_action('init') #10 C:\xampp\htdocs\wp-config.php(90): require_once('C:\xampp\htdocs...') #11 C:\xampp\htdocs\wp-load.php(37): require_once('C:\xampp\htdocs...') #12 C:\xampp\htdocs\wp-blog-header.php(13): require_once('C:\xampp\htdocs...') #13 C:\xampp\htdocs\index.php(17): 要求('C:\xampp\htdocs...' ) #14 {main} throw in C:\xampp\htdocs\wp-includes\widgets.php on line 1265
有同样的问题。 谷歌搜索显示,在过去的几天里,许多其他人也遇到了同样的问题。 问题似乎是 WordPress 与 XAMPP 附带的新 PHP 8.0.0 版本不兼容。 目前的解决方案是卸载 XAMPP 并下载一个旧版本 (PHP 7.4.13)。可以在这里上车:https://www.apachefriends.org/xampp-files/7.4.13/xampp-windows-x64-7.4.13-0-VC15-installer.exe
来源:https://make.wordpress.org/core/2020/11/23/wordpress-and-php-8-0/
https://wordpress.org/support/topic/error-on-setting-up-any-theme/