• Resolved amslps

    (@amslps)


    Hi, the problems had been consistently persisting,

    FastCGI sent in stderr: “PHP message: PHP Warning:  Array to string conversion in /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php on line 606PHP message: PHP Warning:  Array to string conversion in /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php on line 606” while reading response header from upstream, client: 127.0.0.1, server: froninail.com, request: “GET /?id=3446&post_type=product&s=Naruto HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “froninail.com”, referrer: …

    How to eventually fix it? I had set the Facebook Open Graph.

    Thank you!

    • This topic was modified 2 years, 11 months ago by amslps.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @amslps,

    Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.

    From the error code, this happens when the shop or archive page is not able to fetch the image from the first post/product of that archive to set it as the og:image.

    Please make sure that all the custom post types on the website have a fallback thumbnail for Facebook under WordPress Dashboard > Rank Math > Titles & Meta settings to get rid of this warning.

    Also, please note that this is simply a warning, so it won’t cause any issues with the normal functionality of the website, but it won’t include the metadata property.

    Moreover, please check your wp-config.php file if the debug log is set to display the error. If so, you can disable it so the error will not be displayed on your shop page:
    https://ww.wp.xz.cn/support/article/debugging-in-wordpress/

    Hope that helps.

    Thread Starter amslps

    (@amslps)

    I had set the OpenGraph Thumbnail, but why the plugin still caused the fatal error, log from woocommerce log,

    2023-06-29T14:22:05+00:00 CRITICAL Uncaught TypeError: Cannot access offset of type string on string in /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php:522
    Stack trace: 0 /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php(497): RankMath\OpenGraph\Image->set_content_image() 1 /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php(321): RankMath\OpenGraph\Image->set_singular_image() 2 /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php(81): RankMath\OpenGraph\Image->set_images() 3 /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-facebook.php(266): RankMath\OpenGraph\Image->__construct() 4 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(308): RankMath\OpenGraph\Facebook->image() 5 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() 6 /usr/share/nginx/wordpress/wp-includes/plugin.php(565): WP_Hook->do_action() 7 /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(88): do_action_ref_array() 8 /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-opengraph.php(74): RankMath\OpenGraph\OpenGraph->do_action() 9 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(308): RankMath\OpenGraph\OpenGraph->output_tags() 10 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() 11 /usr/share/nginx/wordpress/wp-includes/plugin.php(565): WP_Hook->do_action() 12 /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(88): do_action_ref_array() 13 /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/frontend/class-head.php(157): RankMath\Frontend\Head->do_action() 14 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(308): RankMath\Frontend\Head->head() 15 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() 16 /usr/share/nginx/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action() 17 /usr/share/nginx/wordpress/wp-includes/general-template.php(3043): do_action() 18 /usr/share/nginx/wordpress/wp-content/themes/Astra-Child-Theme/header.php(26): wp_head() 19 /usr/share/nginx/wordpress/wp-includes/template.php(783): require_once('…') 20 /usr/share/nginx/wordpress/wp-includes/template.php(718): load_template() 21 /usr/share/nginx/wordpress/wp-includes/general-template.php(48): locate_template() 22 /usr/share/nginx/wordpress/wp-content/themes/astra/page.php(20): get_header() 23 /usr/share/nginx/wordpress/wp-includes/template-loader.php(106): include('…') 24 /usr/share/nginx/wordpress/wp-blog-header.php(19): require_once('…') 25 /usr/share/nginx/wordpress/index.php(17): require('…') 26 {main} thrown in /usr/share/nginx/wordpress/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php on line 522
    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @amslps,

    Can you please confirm if the error is logged on visiting a specific page or is present site-wide? You can enable the debug display in your wp-config.php file to figure that out. If the error is present on a specific page, then please change the featured image/social image to fix the issue as the error happens when the selected image has incorrect or missing info.

    If the issue is present site-wide, please change the default OpenGraph thumbnail, and the issue should be resolved after that.

    Let us know how that goes. Looking forward to helping you.

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

The topic ‘continue to prompt PHP error’ is closed to new replies.