最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Trying to copy linux blog locally with XAMPP - php fatal error

programmeradmin4浏览0评论

I have a WP blog running on a linux machine.

I need to run it locally on XAMPP on Windows 10.

I copied locally the Wordpress blog files to C:\xampp2\htdocs\mtw I the imported the database and assigned privileges according to the wp-config.

I then changed the URL in wp_options -> siteurl and home to http://localhost/mtw

I am getting the following error on screen:

Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in C:\xampp2\htdocs\mtw\wp-includes\widgets.php:1261 Stack trace: #0 C:\xampp2\htdocs\mtw\wp-includes\widgets.php(1261): array_merge(wp_inactive_widgets: Array, blog_right_sidebar: Array) #1 C:\xampp2\htdocs\mtw\wp-includes\widgets.php(1216): retrieve_widgets(true) #2 C:\xampp2\htdocs\mtw\wp-includes\class-wp-hook.php(289): _wp_sidebars_changed('mtwtheme') #3 C:\xampp2\htdocs\mtw\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #4 C:\xampp2\htdocs\mtw\wp-includes\plugin.php(478): WP_Hook->do_action(Array) #5 C:\xampp2\htdocs\mtw\wp-includes\theme.php(2977): do_action('after_switch_th...', 'mtwtheme', Object(WP_Theme)) #6 C:\xampp2\htdocs\mtw\wp-includes\class-wp-hook.php(287): check_theme_switched('') #7 C:\xampp2\htdocs\mtw\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #8 C:\xampp2\htdocs\mtw\wp-includes\plugin.php(478): WP_Hook->do_action(Array) #9 C:\xampp2\htdocs\mtw\wp-settings.php(540): do_action('init') #10 C:\xampp2\htdocs\mtw\wp-config.php(100): require_once('C:\\xampp2\\htdoc...') #11 C:\xampp2\htdocs\mtw\wp-load.php(37): require_once('C:\\xampp2\\htdoc...') #12 C:\xampp2\htdocs\mtw\wp-admin\admin.php(34): require_once('C:\\xampp2\\htdoc...') #13 C:\xampp2\htdocs\mtw\wp-admin\index.php(10): require_once('C:\\xampp2\\htdoc...') #14 {main} thrown in C:\xampp2\htdocs\mtw\wp-includes\widgets.php on line 1261
There has been a critical error on your website. Please check your site admin email inbox for instructions.

Learn more about debugging in WordPress.

And in the Apache error log:

[Tue Feb 01 16:26:37.958522 2022] [php:error] [pid 15376:tid 1848] [client ::1:52929] PHP Fatal error:  Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in C:\\xampp2\\htdocs\\mtw\\wp-includes\\widgets.php:1261\nStack trace:\n#0 C:\\xampp2\\htdocs\\mtw\\wp-includes\\widgets.php(1261): array_merge(wp_inactive_widgets: Array, blog_right_sidebar: Array)\n#1 C:\\xampp2\\htdocs\\mtw\\wp-includes\\widgets.php(1216): retrieve_widgets(true)\n#2 C:\\xampp2\\htdocs\\mtw\\wp-includes\\class-wp-hook.php(289): _wp_sidebars_changed('mtwtheme')\n#3 C:\\xampp2\\htdocs\\mtw\\wp-includes\\class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)\n#4 C:\\xampp2\\htdocs\\mtw\\wp-includes\\plugin.php(478): WP_Hook->do_action(Array)\n#5 C:\\xampp2\\htdocs\\mtw\\wp-includes\\theme.php(2977): do_action('after_switch_th...', 'mtwtheme', Object(WP_Theme))\n#6 C:\\xampp2\\htdocs\\mtw\\wp-includes\\class-wp-hook.php(287): check_theme_switched('')\n#7 C:\\xampp2\\htdocs\\mtw\\wp-includes\\class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)\n#8 C:\\xampp2\\htdocs\\mtw\\wp-includes\\plugin.php(478): WP_Hook->do_action(Array)\n#9 C:\\xampp2\\htdocs\\mtw\\wp-settings.php(540): do_action('init')\n#10 C:\\xampp2\\htdocs\\mtw\\wp-config.php(100): require_once('C:\\\\xampp2\\\\htdoc...')\n#11 C:\\xampp2\\htdocs\\mtw\\wp-load.php(37): require_once('C:\\\\xampp2\\\\htdoc...')\n#12 C:\\xampp2\\htdocs\\mtw\\wp-admin\\admin.php(34): require_once('C:\\\\xampp2\\\\htdoc...')\n#13 C:\\xampp2\\htdocs\\mtw\\wp-admin\\index.php(10): require_once('C:\\\\xampp2\\\\htdoc...')\n#14 {main}\n  thrown in C:\\xampp2\\htdocs\\mtw\\wp-includes\\widgets.php on line 1261

I tried to troubleshoot that. Removed the database, re-imported, etc. But always the same error.

Can anybody please help?

I have a WP blog running on a linux machine.

I need to run it locally on XAMPP on Windows 10.

I copied locally the Wordpress blog files to C:\xampp2\htdocs\mtw I the imported the database and assigned privileges according to the wp-config.

I then changed the URL in wp_options -> siteurl and home to http://localhost/mtw

I am getting the following error on screen:

Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in C:\xampp2\htdocs\mtw\wp-includes\widgets.php:1261 Stack trace: #0 C:\xampp2\htdocs\mtw\wp-includes\widgets.php(1261): array_merge(wp_inactive_widgets: Array, blog_right_sidebar: Array) #1 C:\xampp2\htdocs\mtw\wp-includes\widgets.php(1216): retrieve_widgets(true) #2 C:\xampp2\htdocs\mtw\wp-includes\class-wp-hook.php(289): _wp_sidebars_changed('mtwtheme') #3 C:\xampp2\htdocs\mtw\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #4 C:\xampp2\htdocs\mtw\wp-includes\plugin.php(478): WP_Hook->do_action(Array) #5 C:\xampp2\htdocs\mtw\wp-includes\theme.php(2977): do_action('after_switch_th...', 'mtwtheme', Object(WP_Theme)) #6 C:\xampp2\htdocs\mtw\wp-includes\class-wp-hook.php(287): check_theme_switched('') #7 C:\xampp2\htdocs\mtw\wp-includes\class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #8 C:\xampp2\htdocs\mtw\wp-includes\plugin.php(478): WP_Hook->do_action(Array) #9 C:\xampp2\htdocs\mtw\wp-settings.php(540): do_action('init') #10 C:\xampp2\htdocs\mtw\wp-config.php(100): require_once('C:\\xampp2\\htdoc...') #11 C:\xampp2\htdocs\mtw\wp-load.php(37): require_once('C:\\xampp2\\htdoc...') #12 C:\xampp2\htdocs\mtw\wp-admin\admin.php(34): require_once('C:\\xampp2\\htdoc...') #13 C:\xampp2\htdocs\mtw\wp-admin\index.php(10): require_once('C:\\xampp2\\htdoc...') #14 {main} thrown in C:\xampp2\htdocs\mtw\wp-includes\widgets.php on line 1261
There has been a critical error on your website. Please check your site admin email inbox for instructions.

Learn more about debugging in WordPress.

And in the Apache error log:

[Tue Feb 01 16:26:37.958522 2022] [php:error] [pid 15376:tid 1848] [client ::1:52929] PHP Fatal error:  Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in C:\\xampp2\\htdocs\\mtw\\wp-includes\\widgets.php:1261\nStack trace:\n#0 C:\\xampp2\\htdocs\\mtw\\wp-includes\\widgets.php(1261): array_merge(wp_inactive_widgets: Array, blog_right_sidebar: Array)\n#1 C:\\xampp2\\htdocs\\mtw\\wp-includes\\widgets.php(1216): retrieve_widgets(true)\n#2 C:\\xampp2\\htdocs\\mtw\\wp-includes\\class-wp-hook.php(289): _wp_sidebars_changed('mtwtheme')\n#3 C:\\xampp2\\htdocs\\mtw\\wp-includes\\class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)\n#4 C:\\xampp2\\htdocs\\mtw\\wp-includes\\plugin.php(478): WP_Hook->do_action(Array)\n#5 C:\\xampp2\\htdocs\\mtw\\wp-includes\\theme.php(2977): do_action('after_switch_th...', 'mtwtheme', Object(WP_Theme))\n#6 C:\\xampp2\\htdocs\\mtw\\wp-includes\\class-wp-hook.php(287): check_theme_switched('')\n#7 C:\\xampp2\\htdocs\\mtw\\wp-includes\\class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)\n#8 C:\\xampp2\\htdocs\\mtw\\wp-includes\\plugin.php(478): WP_Hook->do_action(Array)\n#9 C:\\xampp2\\htdocs\\mtw\\wp-settings.php(540): do_action('init')\n#10 C:\\xampp2\\htdocs\\mtw\\wp-config.php(100): require_once('C:\\\\xampp2\\\\htdoc...')\n#11 C:\\xampp2\\htdocs\\mtw\\wp-load.php(37): require_once('C:\\\\xampp2\\\\htdoc...')\n#12 C:\\xampp2\\htdocs\\mtw\\wp-admin\\admin.php(34): require_once('C:\\\\xampp2\\\\htdoc...')\n#13 C:\\xampp2\\htdocs\\mtw\\wp-admin\\index.php(10): require_once('C:\\\\xampp2\\\\htdoc...')\n#14 {main}\n  thrown in C:\\xampp2\\htdocs\\mtw\\wp-includes\\widgets.php on line 1261

I tried to troubleshoot that. Removed the database, re-imported, etc. But always the same error.

Can anybody please help?

Share Improve this question asked Feb 1, 2022 at 15:35 PikkPikk 2791 gold badge6 silver badges14 bronze badges 1
  • When you move a WP site you not only have to change the options but also do a search/replace on the database itself to replace the old URL with the new one. That said, I'm not sure what's going on here - it could be a plugin or theme causing the issue, or something in the XAMPP configuration itself. You might want to try something like the free program Local (localwp.com) instead of XAMPP just to get around all the potential configuration issues, unless you're set on XAMPP. – Michelle Commented Feb 1, 2022 at 20:13
Add a comment  | 

1 Answer 1

Reset to default 0

Problem solved. Wordpress had an old version. XAMPP had PHP 8. Incompatible. I uninstalled XAMPP and reinstalled an older version with PHP 7.4.

now it's working fine

发布评论

评论列表(0)

  1. 暂无评论