When writing drafts for my blog posts, I prefer to use offline blog authoring editors. First, I used Windows Live Writer, part of Windows Essential, but after it reached end of support in the 2017, I switched to forked open sourced version Open Live Writer. I also installed EasyPHP on my local machine, to publish the drafts to my local WordPress site for further processing. The problem was that the "Open Live Writer" was not letting me add a blog account. It was giving me an error message about Invalid Server Response. In this article, I will show you what I tried and what fixed the issue.
The error message I received was:
Can't connect to your blog service:
Invalid Server Response - The response to the blogger.getUsersBlogs method received from the blog server was invalid:
Invalid response document returned from XmlRpc server
Please try fixing the problem and then try again.
Note: If the blog account is already added, but you cannot login to your blog, then you get "An unexpected error has occurred while attempting to log in:" error with same invalid server response.
When adding a blog account, I also tried to choose “Other services” option, instead of “WordPress”, but received the same error message.
Next I changed the “Web address of your blog:” field to only point to localhost at
This opened a different window “Select blog type”:
After choosing “WordPress 2.2+” from the "Select Blog Provider" dropdown menu, the “Remote posting web address for your blog:” field was filled with the following link:
I edited this link to point to the
xmlrpc.php file of my local WordPress site, but again I received the same error:
It seemed the issue was not with the setup in Open Live Writer / OLW, but was somewhere else. Here are the different ways I tried to solve the problem:
Checking XML-RPC function in WordPress
Since the Open Live Writer error message mentioned XmlRpc and the application was giving me option to add a path to
xmlrpc.php file, I first focused on XML-RPC.
XML Remote Procedure Call or XML-RPC allow you to interact remotely with your WordPress website. There are posts on the web suggesting to turn on XML-RPC in WordPress, but it turns out, this feature is turned on by default since WordPress 3.5.
To determine, if XML-RPC is enabled on WordPress, go to
www.yoursite.com/xmlrpc.php which should give you the following message:
XML-RPC server accepts POST requests only.
If the XML-RPC is enabled, then running
xmlrpc.php in browser will cause 405 status error (Method not allowed) and display the above message as this was GET and not POST requests.
If the message you are receiving says that the requested URL was rejected, check this
article on how to enable it, which might fix the "Invalid Server Response" problem.
In my case, the XML-RPC was working fine, so I kept looking.
Increasing memory limit and File Upload Limit in php.ini
Then I stumbled on some suggestions that the memory_limit or upload_max_filesize in PHP might be too low. Inside the
php.ini file, I had the following settings:
upload_max_filesize = 2M
memory_limit = 128M
They looked fine to me, but I increased the upload_max_filesize to 25M just in case. After stopping / restarting Apache server, this change didn’t do anything.
Checking Open Live Writer log file
Then I discovered that the OpenLiveWriter had a log file.
On Win10, the file is located at:
if you are still using Windows Live Writer, the log file should be located at:
%LOCALAPPDATA%\Windows Live Writer
When I checked the log, I noticed the following error message:
<b>Deprecated</b>: 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 <b>Unknown</b> on line <b>0</b><br />
<b>Warning</b>: Cannot modify header information - headers already sent in <b>Unknown</b> on line <b>0</b><br />
<?xml version=""1.0"" encoding=""UTF-8""?>
This seemed to indicate that while WordPress XRP-RPC was expecting XML format, it instead received the PHP deprecated warning. This warning breaks the XML and causes it to complain that the XML response was invalid. So the obvious solution was to get rid of this deprecated warning.
Removing the PHP deprecated warning
The error in Open Live Writer log file mentioned $HTTP_RAW_POST_DATA being deprecated and to set always_populate_raw_post_data to -1. In
php.ini, this line was commented out:
After removing the comment and restarting the server, the Open Live Writer was able to add a blog account and publish my draft to the local WordPress site without any issue.
For more information about $HTTP_RAW_POST_DATA
, check this official PHP page
Another way to get rid of the warning
The solution in the previous section was simple, but what if you have a notice, strict or deprecated warning and you are unsure how to fix it. The quickest way would be to make sure the PHP doesn't complain about them. We achieve this by setting error_reporting in
php.ini to the values below:
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
If you are using Open Live Writer or any other blog authoring editors and get an error about Invalid Server Response using XML-RPC, it might be due to
php.ini configuration. Checking the Open Live Writer log file can give us a clue, on what exactly is causing the issue. In my case, it was due to PHP "deprecated" warning. Fixing this warning solved the issue.
(Visited 39 times, 15 visits today)