• Hello

    After debugging plugins this problem still remains:

    Fatal error: Uncaught TypeError: mysqli::real_connect(): Argument #5 ($port) must be of type ?int, string given in /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/wp-db.php:2162 Stack trace: #0 [internal function]: mysqli->real_connect() #1 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/wp-db.php(2162): mysqli_query() #2 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/wp-db.php(2051): wpdb->_do_query() #3 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/wp-db.php(2829): wpdb->query() #4 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/meta.php(1173): wpdb->get_results() #5 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/post.php(7498): update_meta_cache() #6 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/post.php(7481): update_postmeta_cache() #7 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/post.php(7864): update_post_caches() #8 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/class-wp-query.php(3106): _prime_post_caches() #9 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/class-wp-query.php(3542): WP_Query->get_posts() #10 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/class-wp.php(637): WP_Query->query() #11 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/class-wp.php(760): WP->query_posts() #12 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/functions.php(1310): WP->main() #13 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-admin/includes/post.php(1239): wp() #14 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-admin/includes/class-wp-posts-list-table.php(166): wp_edit_posts_query() #15 /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-admin/edit.php(225): WP_Posts_List_Table->prepare_items() #16 {main} thrown in /home/676790.cloudwaysapps.com/syackruvsm/public_html/wp-includes/wp-db.php on line 2162
    There has been a critical error on this website. Please check your site admin email inbox for instructions.
    Learn more about troubleshooting WordPress.

    It seems to be 100% wordpress related not plugin. I have checked every forum and post possible, and still dont find anything specific to this issue.
    Ideas?

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there,

    What are you trying to do on the site which is causing this error?

    Thanks

    I’m also getting this issue when upgrading to PHP 8.0.14. Could this be a 8.0.x incompatability?

    Also it seems to be intermittent… i can load the users admin page, but then when i load admins only it fails, but not every time.

    I guess could also be a server issue and/or cache issue?

    In case you haven’t solved it yet. I have had the same error but with other plugins – it seems to manifest with “quick” queries like $wpdb->get_var('...COUNT(*)...');. It appears in core at the moment there is an intermittent connection issue with the ‘null’ being provided in the port. Without editing the WP core files, you can fix it by specifying the port in wp-config.php, for example :

    define('DB_HOST', '127.0.0.1:3306');

    change the host and port according to your DB server configuration.

    • This reply was modified 2 years, 6 months ago by Timothy Wood.

    @codearachnid your solution worked for me!

    Thank you.

    This does seem to be an issue related to upgrading to PHP 8. Thank you providing some insight in this thread.

    Is $wpdb->get_var('...COUNT(*)...'); deprecated? if not perhaps this is worthy of a bug report.

    • This reply was modified 2 years, 2 months ago by Marty.
    Thread Starter thegooddealshop

    (@thegooddealshop)

    @codearachnid worked for me too. Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error: Uncaught TypeError: mysqli::real_connect(): Argument #5 ($port) mus’ is closed to new replies.