admin管理员组文章数量:1415119
The WordPress/WooCommerce API is broken on my site: and both return a blank response.
Running a Python request by
response = requests.get('http://<mysite>/wp-json/wp/v2/posts', auth=HTTPBasicAuth(*auth))
gives a response (examined in a debugger) of
{
...
_content: b''
headers: ... 'content-type': 'text/html' ...
}
According to , the blank response means there is an fatal php error.
Last week I was using the WordPress API to add WC products to my site, with no problems. I believe it stopped working when I installed the WordPress-rest-api plugin, then uninstalled it, after realizing it was not necessary.
I set up a development site as a sanity check and everything worked fine.
Specifically, I want the WooCommerce API to work, but I assume that means the rest API should also work.
We have backups, but there have been some changes since the last backup. Do I have to recreate the site from backup for it to work again?
EDIT:
The only error in error_log
is
[PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is
deprecated and will be removed in a future version.
To avoid this warning set 'always_populate_raw_post_data' to '-1'
in php.ini and use the php://input stream instead.
in Unknown on line 0
which does NOT occur at the same times as my API requests.
The WordPress/WooCommerce API is broken on my site: http://example/wp-json/wp/v2/posts and http://example/wp-json/wc/v2/products both return a blank response.
Running a Python request by
response = requests.get('http://<mysite>/wp-json/wp/v2/posts', auth=HTTPBasicAuth(*auth))
gives a response (examined in a debugger) of
{
...
_content: b''
headers: ... 'content-type': 'text/html' ...
}
According to https://github/WP-API/WP-API/issues/2911, the blank response means there is an fatal php error.
Last week I was using the WordPress API to add WC products to my site, with no problems. I believe it stopped working when I installed the WordPress-rest-api plugin, then uninstalled it, after realizing it was not necessary.
I set up a development site as a sanity check and everything worked fine.
Specifically, I want the WooCommerce API to work, but I assume that means the rest API should also work.
We have backups, but there have been some changes since the last backup. Do I have to recreate the site from backup for it to work again?
EDIT:
The only error in error_log
is
[PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is
deprecated and will be removed in a future version.
To avoid this warning set 'always_populate_raw_post_data' to '-1'
in php.ini and use the php://input stream instead.
in Unknown on line 0
which does NOT occur at the same times as my API requests.
Share Improve this question edited Jun 17, 2017 at 12:48 Elliott Beach asked Jun 16, 2017 at 13:14 Elliott BeachElliott Beach 1116 bronze badges 1- A completely blank page is usually a fatal error as you said, so the first step would be to look at the error log and see what the error is. If you can restore a complete backup of the code & data from before things broke that's another option. – user66711 Commented Jun 16, 2017 at 13:20
1 Answer
Reset to default 0Uninstalling and reinstalling all plugins revealed the answer, which I recommend as the first step for addressing this sort of problem.
The problem was apparently due to a conflict between WC-Vendors and another plugin which declared the same class WC_Email_Notify_Shipped
. So I disabled WC-Vendors, which we weren't using at the time.
本文标签: woocommerce offtopicAPI returns blank response after installing amp uninstalling WPrestapi plugin
版权声明:本文标题:woocommerce offtopic - API returns blank response after installing & uninstalling WP-rest-api plugin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745224247a2648533.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论