• Hello,

    I am French and my English is not very good, I use google translate.

    when my website is set to php 8.0 and wordpress 5.6 there is an error message on all pages except the home pages.

    Here it is :

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), 0 passed in /homepages/29/d475204339/htdocs/wp-includes/class-wp-widget-factory.php on line 61 and at least 2 expected in /homepages/29/d475204339/htdocs/wp-includes/class-wp-widget.php:162 Stack trace: #0 /homepages/29/d475204339/htdocs/wp-includes/class-wp-widget-factory.php(61): WP_Widget->__construct() #1 /homepages/29/d475204339/htdocs/wp-includes/widgets.php(115): WP_Widget_Factory->register('VMenuWidget') #2 /homepages/29/d475204339/htdocs/wp-content/themes/MWS4/library/widgets.php(244): register_widget('VMenuWidget') #3 /homepages/29/d475204339/htdocs/wp-includes/class-wp-hook.php(287): artWidgetsInit('') #4 /homepages/29/d475204339/htdocs/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #5 /homepages/29/d475204339/htdocs/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #6 /homepages/29/d475204339/htdocs/wp-includes/widgets.php(1795): do_action('widgets_init') #7 /homepages/29/d475204339/htdocs/wp-includes/class-wp-hook.php(287): wp_widgets_init('') #8 /homepages/29/d475204339/htdocs/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #9 /homepages/29/d475204339/htdocs/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #10 /homepages/29/d475204339/htdocs/wp-settings.php(557): do_action('init') #11 /homepages/29/d475204339/htdocs/wp-config.php(105): require_once('/homepages/29/d...') #12 /homepages/29/d475204339/htdocs/wp-load.php(37): require_once('/homepages/29/d...') #13 /homepages/29/d475204339/htdocs/wp-blog-header.php(13): require_once('/homepages/29/d...') #14 /homepages/29/d475204339/htdocs/index.php(17): require('/homepages/29/d...') #15 {main} thrown in /homepages/29/d475204339/htdocs/wp-includes/class-wp-widget.php on line 162

    If you have the solution I am interested. My site is currently running PHP 7.4 and wordpress 5.6.

    • This topic was modified 3 years, 4 months ago by Touny.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Dion

    (@diondesigns)

    The solution is to stick with PHP 7.4 since WordPress 5.6 still has some PHP 8.0-related glitches.

    And strictly personal opinion, but one would have to be out of their mind to run PHP 8.0.0 on a production server, especially if it was built with opacache JIT enabled. The PHP developers always maintain two active branches, commonly referred to as “development stable” and “production stable”, and production servers should strive to run the latest version of PHP in the “production stable” branch.

    I really wish WordPress would recommend the latest version in the “production stable” branch in Site Health, not the latest version in the “development stable” branch. Problems such as yours would seldom if ever occur if this were done, and a notice box was added that said something like:

    While WordPress makes every effort to be compatible with the latest version of PHP in the development stable branch (currently 8.0), we cannot guarantee compatibility with it.

    Thread Starter Touny

    (@touny)

    Hello,

    Thank you for your feedback. However, a solution must exist. While browsing the forum I found someone who encountered a similar problem, but I did not understand everything:

    https://wordpress.org/support/topic/wp-5-6-rc4-php-8-0-uncaught-argumentcounterror/

    I revived this topic, but was advised to open my own post.

    • This reply was modified 3 years, 4 months ago by Touny.
    Dion

    (@diondesigns)

    A solution does exist…use PHP 7.4 until issues with PHP 8.0, and WordPress compatibility with PHP 8.0, are sufficiently resolved.

    The term “bleeding edge” exists for a very good reason. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“Uncaught ArgumentCountError” – WP 5.6 – PHP 8.0’ is closed to new replies.