FATAL ERROR with NGINX

#61115
  • Resolved Maxime
    Rank Math free

    Hello, RankMath plugin detected that I was using an NGINX server.
    I was asked to add the following code:

    # START Nginx Rewrites for Rank Math Sitemaps
    rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
    rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
    # END Nginx Rewrites for Rank Math Sitemaps

    I then asked assistance to my host who installed the code but that to create errors:

    2020/06/12 16:17:42 [error] 23828#23828: *142390 FastCGI sent in stderr: “PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function is_cart() in (I hide my site address)/public/wp-content/plugins/seo-by-rank-math/includes/class-post.php:172
    Stack trace:
    #0 (I hide my site address)/public/wp-content/plugins/seo-by-rank-math/includes/frontend/paper/class-paper.php(525): RankMathPost::is_woocommerce_page()
    #1 (I hide my site address)/public/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php(440): RankMathPaperPaper::should_apply_shortcode()
    #2 (I hide my site address)/public/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php(305): RankMathReplace_VariablesPost_Variables->get_post_content(Object(stdClass))
    #3 (I hide my site address)/public/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php(59): RankMathReplace_VariablesPost_Variables->get_excerpt()
    #4 (I hide my site address)/” while reading response header from upstream, client: 174.118.220.229, server: fr.maximelesmotsducoeur.com, request: “GET / HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php7.4-fpm-maximelesmotsducoeurfrance.sock:”, host: “fr.maximelesmotsducoeur.com”

    My interdmaire pointed out to me maybe a PHP version problem :

    Your sites are using the latest stable version of PHP; but the error log I pasted indicates a scripting/coding issue with the plugin itself:
    PHP Fatal error:  Uncaught Error: Call to undefined function is_cart() in (I hide my site address)/public/wp-content/plugins/seo-by-rank-math/includes/class-post.php:172

    Thank you for your assistance, have a nice day

    • This topic was modified 3 years, 10 months ago by Maxime.
    • This topic was modified 3 years, 8 months ago by Maxime.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    The is_cart() function is defined in the WooCommerce plugin and before using it we check if the plugin is active on the site.

    Assuming you are using the latest version of all the plugins and the themes (please update if not yet), it would seem like a conflict with one of the plugins or the theme you are using.

    To determine that, please follow this troubleshooting guide:
    https://rankmath.com/kb/check-plugin-conflicts/

    Please let us know if you find the culprit.

    Only the site admin would know and your users won’t be affected by this troubleshooting.

    Looking forward to helping you.

    Maxime
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    We have received your other ticket and we will get back to you on that.

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘FATAL ERROR with NGINX’ is closed to new replies.