• Hello, i need your help for a migration of my wordpress from an ovh server to a viurtual machine for make a backup. I want to upgrade my server on debian 11 and the latest version of apache, php and mariadb. Actualy i have php 7.4.29 and wordpress 6.3.1 and MariaDB version 10.4.

    So i tried to import my backup on my VM for testing my config before migration.

    Error message after import database backup:

    ArgumentCountError thrownToo few arguments to function WP_Widget::__construct(), 0 passed in /var/www/wordpress/wp-includes/class-wp-widget-factory.php on line 62 and at least 2 expected

    Thanks for your help

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter deug7

    (@deug7)

    This part of the file class-wp-widget-factory.php:

    sed ‘16,65!d’ /var/www/wordpress/wp-includes/class-wp-widget-factory.php [AllowDynamicProperties]

    class WP_Widget_Factory {

    /**
     * Widgets array.
     *
     * @since 2.8.0
     * @var array
     */
    public $widgets = array();
    
    /**
     * PHP5 constructor.
     *
     * @since 4.3.0
     */
    public function __construct() {
        add_action( 'widgets_init', array( $this, '_register_widgets' ), 100 );
    }
    
    /**
     * PHP4 constructor.
     *
     * @since 2.8.0
     * @deprecated 4.3.0 Use __construct() instead.
     *
     * @see WP_Widget_Factory::__construct()
     */
    public function WP_Widget_Factory() {
        _deprecated_constructor( 'WP_Widget_Factory', '4.3.0' );
        self::__construct();
    }
    
    /**
     * Registers a widget subclass.
     *
     * @since 2.8.0
     * @since 4.6.0 Updated the $widget parameter to also accept a WP_Widget instance object
     *              instead of simply a WP_Widget subclass name.
     *
     * @param string|WP_Widget $widget Either the name of a WP_Widget subclass or an instance of a WP_Widget subclass.
     */
    public function register( $widget ) {
        if ( $widget instanceof WP_Widget ) {
            $this->widgets[ spl_object_hash( $widget ) ] = $widget;
        } else {
            $this->widgets[ $widget ] = new $widget();
        }
    }
    Thread Starter deug7

    (@deug7)

    I fixed my issue by changing the php version. My website is in php7.4 and my new installation is in php8.2, so some plugins or themes were not compatible.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Migration wordpress to another server whith an old version php and mysql’ is closed to new replies.