• My site has no problem in front page, but in the error_log file record error after I creat a new post (same error for each of post).

    Example for a error on 26Jul:

    [26-Jul-2016 18:05:55 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [26-Jul-2016 19:30:32 UTC] C? s? d? li?u c?a WordPress g?p l?i Illegal mix of collations for operation ‘ IN ‘ v?i truy v?n
    SELECT
    target.post_id, sum(target.weight * log(26 / least(26, freqs.freq))) as score
    FROM
    wp2_zem_rp_tags as target,
    (SELECT label, count(1) as freq FROM wp2_zem_rp_tags
    WHERE label IN (‘P_c? gái cam’, ‘P_gi? l?i h?a’, ‘C_kinh nghi?m s?ng’, ‘A_anh’, ‘A_gi’, ‘A_cu’, ‘A_trai’, ‘A_ngai’, ‘A_trong’, ‘A_gia’, ‘A_gin’, ‘A_vin’, ‘A_ng’, ‘A_vo’, ‘A_cho’, ‘A_quan’, ‘A_nh’, ‘A_yu’)
    GROUP BY label
    ) as freqs
    WHERE
    target.post_id NOT IN (‘1066’) AND

    target.label=freqs.label AND
    target.label IN (‘P_c? gái cam’, ‘P_gi? l?i h?a’, ‘C_kinh nghi?m s?ng’, ‘A_anh’, ‘A_gi’, ‘A_cu’, ‘A_trai’, ‘A_ngai’, ‘A_trong’, ‘A_gia’, ‘A_gin’, ‘A_vin’, ‘A_ng’, ‘A_vo’, ‘A_cho’, ‘A_quan’, ‘A_nh’, ‘A_yu’)
    GROUP BY target.post_id
    ORDER BY score desc, target.post_id desc
    LIMIT 8; yêu c?u b?i require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/vntp1/single.php’), get_template_part, locate_template, load_template, require(‘/themes/vntp1/content-single.php’), the_content, apply_filters(‘the_content’), call_user_func_array, zem_rp_add_related_posts_hook, zem_rp_get_related_posts, zem_rp_fetch_posts_and_title, zem_rp_append_posts, call_user_func, zem_rp_fetch_related_posts_v2

    Line 3384 in formatting.php:

    $url = str_replace( ' ', '%20', $url );

    How can I fix this error? Front page has no problem but the error_log file is more full day by day with new post.
    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Gakho209,

    These two errors don’t seem directly related, and the first is nondescript, it just says that the string replace function is returning an error for some reason. The $url variable may be getting set improperly by something else, but it’s hard to say without delving deep.

    After a bit of looking into the second error it seems like this error is coming from a “Related posts” plugin by Zemanta. You could test to verify by disabling the plugin (ZeroBull guide). Once you’re sure I’d advise reporting the issue to Zemanta. They may be aware of the issue and ready with a fix, or they may be able to fix it quickly as they’re familiar with the plugin – and then everyone would get a patch for it.

    If you have any more questions, or other errors coming up, let me know!

    Thread Starter gakho209

    (@gakho209)

    Dear zerobullhosting,
    Great! That’s all what you say. After I remove this plugin (Related post by Zemanta), both error disappears.

    However, I used this plugin for another site demo, it’s no problem. So I think, it may conflict with other plugin.

    Anyway, I installed Related post lite plugin, and it’s ok.

    Thank you very much. Have a nice day.

    Thread Starter gakho209

    (@gakho209)

    Dear @zerobullhosting,
    I just detected that the 1st error still existed. Can you guide me how to find reason and fix it?
    Below is a part of error:

    [01-Aug-2016 22:14:34 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [02-Aug-2016 18:45:22 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [02-Aug-2016 18:45:46 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [02-Aug-2016 19:05:55 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [02-Aug-2016 19:07:57 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [02-Aug-2016 19:08:28 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [02-Aug-2016 19:41:46 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [02-Aug-2016 19:53:38 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [02-Aug-2016 19:56:50 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [03-Aug-2016 23:01:20 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384
    [07-Aug-2016 01:02:59 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/vntb210a/public_html/wp-includes/formatting.php on line 3384

    Without being able to get in and look through I can only guess – but most likely it’s being caused by a plugin that is changing the $url variable that that line of formatting.php uses. If it was set to a value of improper type, this error would be the result.

    The easiest way to figure out what plugin it is would be if you knew an action that replicated it 100% of the time and could disable all plugins, then test, then slowly re-enable plugins and continue testing each time until the culprit was found.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error in error_log file after creat a new post’ is closed to new replies.