PHP Error After Migration to Localhost
-
After pulling down a site to my localhost along with the sql database I get an error:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), 0 passed in C:\xampp\htdocs\district4\wp-includes\class-wp-widget-factory.php on line 62 and at least 2 expected in C:\xampp\htdocs\district4\wp-includes\class-wp-widget.php:163 Stack trace: #0 C:\xampp\htdocs\district4\wp-includes\class-wp-widget-factory.php(62): WP_Widget->__construct() #1 C:\xampp\htdocs\district4\wp-includes\widgets.php(115): WP_Widget_Factory->register(‘WPGCWidget’) #2 C:\xampp\htdocs\district4\wp-content\plugins\wp-gcalendar\admin\partials\widgets.php(51): register_widget(‘WPGCWidget’) #3 C:\xampp\htdocs\district4\wp-includes\class-wp-hook.php(308): WPGC_widget_init(”) #4 C:\xampp\htdocs\district4\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #5 C:\xampp\htdocs\district4\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #6 C:\xampp\htdocs\district4\wp-includes\widgets.php(1854): do_action(‘widgets_init’) #7 C:\xampp\htdocs\district4\wp-includes\class-wp-hook.php(308): wp_widgets_init(”) #8 C:\xampp\htdocs\district4\wp-includes\class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #9 C:\xampp\htdocs\district4\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #10 C:\xampp\htdocs\district4\wp-settings.php(617): do_action(‘init’) #11 C:\xampp\htdocs\district4\wp-config.php(93): require_once(‘C:\\xampp\\htdocs…’) #12 C:\xampp\htdocs\district4\wp-load.php(50): require_once(‘C:\\xampp\\htdocs…’) #13 C:\xampp\htdocs\district4\wp-blog-header.php(13): require_once(‘C:\\xampp\\htdocs…’) #14 C:\xampp\htdocs\district4\index.php(17): require(‘C:\\xampp\\htdocs…’) #15 {main} thrown in C:\xampp\htdocs\district4\wp-includes\class-wp-widget.php on line 163
So after downloading the site I changed the wp-config.php to the correct localhost and DB info,. imported the database into phpmyadmin, change the “siteurl” and “home” rows in the wp-options table to the localhost domain (localhost/district4). Upon loading the site I get the error above. I have also tried to change the theme manually in the wp_options table “twentytwentytwo” and that didn’t fix the problem either. This is something I have done this many times and I have never had this happen.
I am using a newer version of XAMPP running 8.1.12 and the server this came from is running PHP 7.4.29.
Are the two different PHP versions the problem? How can I fix this?
The topic ‘PHP Error After Migration to Localhost’ is closed to new replies.