Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Anatolie

    (@toleanu)

    Can you/I edit the initial post ? I forgot to mask the path of the app in the first row of the error.
    I can’t seem to find a way.

    Thread Starter Anatolie

    (@toleanu)

    So, for other with same error and with WP, without editing the WP core files, you can fix it by specifying the port in wp-config, 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 4 years, 1 month ago by Anatolie.
    Thread Starter Anatolie

    (@toleanu)

    Another observation:
    It happens only with heavier queries e.g. LIKE on post_content or = and LIKE on meta_value. With simple queiries e.g. meta_key = 'something' and post_title LIKE %somethingelse% on simple columns, this does not happen (or the rate is so low I was not able to catch it).

    • This reply was modified 4 years, 1 month ago by Anatolie.
    • This reply was modified 4 years, 1 month ago by Anatolie.
    • This reply was modified 4 years, 1 month ago by Anatolie.
    Thread Starter Anatolie

    (@toleanu)

    Can you/I edit the initial post ? I forgot to mask the path of the app in the first row of the error.
    I can’t seem to find a way.

    Moreover : after more debugging it seems to be a bug in PHP 8.0 or WP. I took the code in a separate file and run it with php cli and can reproduce:

    <?php
    $dbh = mysqli_init();
    mysqli_real_connect( $dbh, 'localhost', '<dbuser>', '<pass>', '<dbname>', null , null);
    mysqli_query($dbh, "SELECT post_id FROM wp_postmeta WHERE meta_value = 'teststring'");
    

    Running this sometimes works sometimes we get the error from above.
    If we remove the last null which should be the $socket arg, then it always works. Also if we specify the $port argument instead of null, also works.

    mysqli_real_connect( $dbh, 'localhost', '<dbuser>', '<pass>', '<dbname>', null);

    Thread Starter Anatolie

    (@toleanu)

    Indeed,
    I found out it happens on other occasions (as seen in previous trace).
    Here is one trace with the query-monitor in it (this one stopped happening after disabling the query monitor):

    in mysqli::real_connect called at ? (?)
    in mysqli_query called at /home/<app_name>/public_html/wp-includes/wp-db.php (2162)
    in wpdb::_do_query called at /home/<app_name>/public_html/wp-includes/wp-db.php (2051)
    in wpdb::query called at /home/<app_name>/public_html/wp-content/plugins/query-monitor/wp-content/db.php (114)
    in QM_DB::query called at /home/<app_name>/public_html/wp-includes/wp-db.php (2829)
    in wpdb::get_results called at /home/<app_name>/public_html/wp-includes/class-wp-user-query.php (776)
    in WP_User_Query::query called at /home/<app_name>/public_html/wp-includes/class-wp-user-query.php (78)
    in WP_User_Query::__construct called at /home/<app_name>/public_html/wp-includes/sitemaps/providers/class-wp-sitemaps-users.php (118)
    in WP_Sitemaps_Users::get_max_num_pages called at /home/<app_name>/public_html/wp-includes/sitemaps/class-wp-sitemaps-provider.php (76)
    in WP_Sitemaps_Provider::get_sitemap_type_data called at /home/<app_name>/public_html/wp-includes/sitemaps/class-wp-sitemaps-provider.php (106)
    in WP_Sitemaps_Provider::get_sitemap_entries called at /home/<app_name>/public_html/wp-includes/sitemaps/class-wp-sitemaps-index.php (60)
    in WP_Sitemaps_Index::get_sitemap_list called at /home/<app_name>/public_html/wp-includes/sitemaps/class-wp-sitemaps.php (192)
    in WP_Sitemaps::render_sitemaps called at /home/<app_name>/public_html/wp-includes/class-wp-hook.php (307)
    in WP_Hook::apply_filters called at /home/<app_name>/public_html/wp-includes/class-wp-hook.php (331)
    in WP_Hook::do_action called at /home/<app_name>/public_html/wp-includes/plugin.php (474)
    in do_action called at /home/<app_name>/public_html/wp-includes/template-loader.php (13)
    in require_once called at /home/<app_name>/public_html/wp-blog-header.php (19)
    in require called at /home/<app_name>/public_html/index.php (17)

    Here is the definition of the DB_HOST (it has no port):
    define(‘DB_HOST’, ‘localhost’);

    • This reply was modified 4 years, 1 month ago by Anatolie.

    Since TeslaThemes was sold to Imagely they don’t pay attention to this plugin nor any other free stuff. I offered to help but got no reply. Total ignore towards the community.

    @d-phrag Had this issue too ,

    Contacted host and asked about my PHP version and it was something 5.2.x so I requested an update , now running on 5.6 smoothly.

    Found my problem :

    woocommerce_get_template('shop/breadcrumb.php', $args);

    changed to :

    woocommerce_get_template('global/breadcrumb.php', $args);

    Good luck to all other theme developers !

    Hi @coen Jacobs .

    I work in themes industry and when you have >20 themes is hard to keep up with news .

    Anyway , a link to how we can work around this issue would be better than pushing charges against developers.

    PS: Yes I’ve searched google and your website for that specific link.

    Thank you .

Viewing 10 replies - 1 through 10 (of 10 total)