After updating to PHP 8.1 from PHP 7.4 Some Pages Showing Critical Error

#732200
  • Resolved Raman Sharma
    Rank Math free

    My theme developer and web host both indicated the error is due to Rank Math plugin compatibility with PHP 8. The search page and author pages are showing a critical error screen when RankMath breadcrumbs are on and when they are off, the error just goes away. All this happens only when the PHP version is 8 or above, not with the 7.4 PHP version.

    The weird thing is that on those search and author pages, we are not even using the breadcrumbs code provided by RankMath we are using only on single posts.

    Please provide a solution to why this is happening.

    My website: allusefulinfo.com
    Mainly affected pages: search and author pages

    Currently on the live website, I turned off the breadcrumbs to temporarily fix the error. You can test it on staging where I set the PHP 8.1 version for you to check: https://l3e5fydea0-staging.onrocket.site/author/adminrksh/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello,

    We apologize for the inconvenience you are facing with the Rank Math plugin after updating to PHP 8.1. We understand that some pages are showing a critical error when the RankMath breadcrumbs are on, and the issue goes away when they are turned off.

    Based on the information provided, it seems that the issue is specific to the PHP version 8 or above and is related to the breadcrumbs functionality of Rank Math. This could be due to a conflict with the PHP version and how the breadcrumbs are being handled on search and author pages.

    To address this issue, we recommend following these steps:

    1. Check for Conflict with Theme: Ensure that the breadcrumbs function is added to your theme file, and then validate the Schema Markup code to see if you’re able to reproduce the error. If you’re able to reproduce the issue, then you can confirm there is a conflict with your theme in adding the Breadcrumb Schema. We advise reaching out to your theme’s support to get the issue resolved.

    2. Open a Support Ticket: If the issue persists after checking for conflicts with the theme, we recommend opening a support ticket on our community forum at Rank Math Support so that our support experts can investigate this further and provide you with a solution.

    We hope this helps in resolving the issue you are facing. Thank you for bringing this to our attention, and we appreciate your patience as we work to address this matter.

    If you have any further questions or need additional assistance, please feel free to reach out.

    Sources:
    Fatal Error Happening on Some Installations After 1.0.49 Update » Rank Math
    How to Fix “Invalid object type for field ‘item'” » Rank Math
    Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
    This Plugin Does Not Work with Your Version of PHP » Rank Math

    Hello,

    Thank you for contacting us and we are sorry for any inconvenience that might have been caused due to that.

    Can you please share the error log with us?

    Having the error log file will give a clear idea of why this might be happening.

    You can follow this guide to enable debugging in WordPress https://wordpress.org/support/article/debugging-in-wordpress/ or you can get in touch with your web host, and they will help you locate the log file.

    Looking forward to helping you.

    Thank you.

    I am eagerly waiting for a response. May I have an update a bit faster because I am not making any changes even to the live website until this issue is resolved?

    It has been around 24 hours since my message with the error log but I haven’t heard back from anyone at Rank Math. As said before, I am eagerly waiting to get this solved as soon as possible.

    Hello,

    Thank you for getting back to me. I tried to recreate the error in the staging environment. This is the staging domain: https://stg-allusefulinfocom-staging.kinsta.cloud/

    Please the check error log below:

    2024/01/28 12:24:21 [error] 7588#7588: *1022 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught ValueError: Missing padding character in /www/allusefulinfocom_758/public/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php:273
    Stack trace:
    #0 /www/allusefulinfocom_758/public/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php(273): sprintf('Search for '%'', 'seo')
    #1 [internal function]: RankMath\Frontend\Breadcrumbs->add_crumbs_search()
    #2 /www/allusefulinfocom_758/public/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php(231): call_user_func(Array)
    #3 /www/allusefulinfocom_758/public/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php(174): RankMath\Frontend\Breadcrumbs->generate()
    #4 /www/allusefulinfocom_758/public/wp-content/plugins/seo-by-rank-math/includes/modules/schema/snippets/class-breadcrumbs.php(34): RankMath\Frontend\Breadcrumbs->get_crumbs()
    #5 /www/allusefulinfocom_758/public/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-j" while reading response header from upstream, client: 2405:201:3033:a0a4:2580:624:84d4:1e16, server: stg-allusefulinfocom-staging.kinsta.cloud, request: "GET /?s=seo HTTP/2.0", upstream: "fastcgi://unix:/var/run/php8.1-fpm-allusefulinfocom.sock:", host: "stg-allusefulinfocom-staging.kinsta.cloud:44977", referrer: "https://stg-allusefulinfocom-staging.kinsta.cloud/"

    Thank you.

    Hello,

    Apologies for the delay as we prioritize older tickets, and whenever you post a reply here, your ticket is getting bumped to the top.

    However, this is most likely an issue with your Breadcrumb search result format and you can usually fix this by adding %s to the Search Results Format in your Breadcrumb settings:

    1. Go to Rank Math > General Settings > Breadcrumbs in your WordPress dashboard.
    2. Find the option that says Search Results Format and change it to Search for %s or anything else that has %s in it
    3. Save your changes and clear your website’s cache.
    4. Check if the search page is working properly now.

    Let us know how this goes.

    Thank you.

    Thank you for your kind reply. Actually, I always got fast replies from Rank Math but this time delayed so I replied to seek an update from your side because my website was in critical error.

    Anyways, thanks for the fix. It worked.

    But, do I need to replace other sections having a % sign? For example, %title% to %stitle%s and %excerpt% to %sexcerpt%s and many other occurrences of this sign?

    Looking forward to your response.

    Hello,

    Thank you for your patience.

    No, you won’t need to edit the other variables as it only applies to the search results in the breadcrumbs option.

    So, you can still continue to use the same ones you have shared without adding extra characters.

    Looking forward to helping you.

    And what about the section Archive Format? Before your fix was provided, it was Archives for % but now I changed it to Archives for %s after your fix provided. So, is this correct? After changing to Archives for %s nothing is broken, even the broken Author page was fixed.

    Hello,

    The Archive format option in Breadcrumbs lets you set a breadcrumb format for the archive pages. You can customize it completely, but we recommend that you don’t remove the %s from it, as it represents the taxonomy.

    If now you’re using Archives for %s, then it is correct.

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘After updating to PHP 8.1 from PHP 7.4 Some Pages Showing Critical Error’ is closed to new replies.