Woocommerce Setup Failed

╄→尐↘猪︶ㄣ 提交于 2021-02-08 07:39:56

问题


I tried to install woocommerce on a fresh WordPress 5.4.1 installation.

Woocommerce plugin was successfully installed, but when setting up the store, there's an error, it says There was a problem updating your preferences, I checked the browser console, and from the ajax call it received :

{"code":"woocommerce_rest_cannot_view","message":"You must supply an array of options.","data":500}

I tried to remove the application folder and database, then recreated a new empty database then reinstall the WordPress, then setting up the store, but still receiving the same error.


回答1:


I finally found a workaround, I'm sharing it just in case anyone having the same problem as I do.

Someone suggested me to check the Site Health, so I went over there and found 3 warnings, the last one was the only one I had to pay attention, it said The REST API did not process the 'context' query parameter correctly, so I googled it and then found a workaround, then applied it, and finally the error gone.

Here's the workaround, need to add this in the Nginx configuration :

location ~ ^/wp-json/ {
   rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last;
}

and then, restart the nginx service




回答2:


For any one have the problem There was a problem updating your preferences at the current time and this may be changed soon use PHP version 7.2 this will solve the problem which mostly happens when you use PHP version 7.4




回答3:


Try to change Timezone to your local time from wordpress settings. It worked for me.



来源:https://stackoverflow.com/questions/61836808/woocommerce-setup-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!