Answer a question

We manage a wordpress site for someone who is sometimes receiving an issue where people can't progress on the checkout. We can't replicated, but have identified that when this happens a 403 occurs:

[25/Feb/2021:21:33:23 +0000] "POST /?wc-ajax=update_order_review HTTP/1.0" 403 5 "https://www._______.co.uk/checkout/" "Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G970F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/13.2 Chrome/83.0.4103.106 Mobile Safari/537.36"

Please could someone help us identify the issue? We have set all the permissions and this still sometimes occurs. This also only happens sometimes and others it does not.

Server details: Site is running on php 7.4 and Nginx

Error logs for when someone experienced a 403 (I can't see any fatal errors, just warnings):

2021/02/24 16:58:47 [error] 25593#0: *149666 FastCGI sent in stderr: "PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 1177
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 1214
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 1218
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 1243
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 2959
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 2966
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 2979" while reading response header from upstream, client: 10.94.185.1, server: , request: "POST /?wc-ajax=update_order_review HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www._______.co.uk", referrer: "https://www._______.co.uk/checkout/"
2021/02/24 16:58:47 [error] 25593#0: *149665 FastCGI sent in stderr: "PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 1177
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 1214
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 1218
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 1243
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 2959
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 2966
PHP message: PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wp-content/plugins/gravityforms/common.php on line 2979
PHP message: The WC_Cart::get_remove_url function is deprecated since version 3.3. Replace with wc_get_cart_remove_url.
PHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.
PHP message: The WC_Cart::get_remove_url function is deprecated since version 3.3. Replace with wc_get_cart_remove_url.
PHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.
PHP message: The WC_Cart::get_remove_url function is deprecated since version 3.3. Replace with wc_get_cart_remove_url.
PHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace wi
2021/02/24 16:58:47 [error] 25593#0: *149665 FastCGI sent in stderr: " WC_Cart::get_remove_url function is deprecated since version 3.3. Replace with wc_get_cart_remove_url.
PHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.
PHP message: The WC_Cart::get_remove_url function is deprecated since version 3.3. Replace with wc_get_cart_remove_url.
PHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.
PHP message: The WC_Cart::get_cart_url function is deprecated since version 2.5. Replace with wc_get_cart_url.
PHP message: The WC_Cart::get_checkout_url function is deprecated since version 2.5. Replace with wc_get_checkout_url" while reading response header from upstream, client: 10.94.185.1, server: , request: "POST /?wc-ajax=get_refreshed_fragments HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.______.co.uk", referrer: "https://www.______.co.uk/checkout/"

NGINX configuration:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www;
    index index.php index.html index.htm index.nginx-debian.html;


    location / {;
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }


    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        include         fastcgi_params;
        fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
        fastcgi_param   REMOTE_ADDR    $http_x_real_ip;
    }

    location ~ /\.ht {
        deny all;
    }
}

Answers

For anyone with a similar issue, we have switched the site to use Apache rather than nginx, it seems to have resolved the issue.

Logo

WooCommerce社区为您提供最前沿的新闻资讯和知识内容

更多推荐