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?

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

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.