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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745224247a4617387.html
评论列表(0条)