WordPress
Blogging.WordPress History
Hide minor edits - Show changes to markup
- Update:** Starting with revision 9600 of the blogging bundle, we include GMT date headers (a WordPress extension).
- Enabling Full Logging (XML-RPC)
Sometimes it is necessary to enable full logging (server side) to debug a problem.
To do this, edit `xmlrpc.php` (on your server). Search for this line:
$xmlrpc_logging = 0;
And change it so that it sets the variable to `1` instead of `0`.
A few lines down you will find:
if ($xmlrpc_logging) {
$fp = fopen("../xmlrpc.log","a+");
This has the log file placed in the parent folder (i.e. the one containing your blog), if the process that runs your blog (e.g. apache) can’t write to this folder, you will need to alter the path, make it so that apache can write to the parent folder, or create the file and make it world-writable.
For the latter (assuming we are in the blog directory) do:
touch ../xmlrpc.log
chmod a+w ../xmlrpc.log
- Server accepts POST requests only
If you get an error like `server accepts POST requests only` then that’s caused by a PHP 5.2.2 bug.
See [this article](http://www.rahji.com/wordpress/2007/05/18/wordpress-blogging-with-textmate/) for a workaround.
If you are in a time zone other than GMT and want to specify post dates, do the following:
1. Set TextMate's environment variable `TM_SEND_DATE_TO_WP` to a value of `YES`. You can add and edit it in *Preferences > Advanced > Shell Variables*. 2. Download this [patch file](http://martinwinter.com/downloads/wp-xmlrpc-mw-gmt-patch). 3. Download or copy the file `xmlrpc.php` from the root folder of your Wordpress installation. 4. Make sure that both the patch file and the PHP file are in the same location on your computer. 5. Open the Terminal, navigate to where you put the two files, and type the following command:
patch < wp-xmlrpc-mw-gmt-patch
5. Your `xmlrpc.php` file will have been patched. Upload or copy it to the root folder of your Wordpress installation, replacing the old version.
**Note:** Without the patch, the XML-RPC reply of Wordpress contains the post date as it appears on the post's page. This date, however, lacks time zone information. Thus the Blogging bundle interprets this as a GMT date and over-adjusts for the computer time zone. The patch fixes this by actually converting the date to GMT before sending it via XML-RPC.
You now can specify dates with time zone information:
Date: 2006-11-24 18:36:45 +0100
Also, if you have not done so, please check the time offset in your Wordpress installation under *Options > General > Times in the weblog should differ by*.
There has been a few problems related to correct dates. This comes from the fact that the `dateCreated` argument (in the XML-RPC protocol) has no time zone info, and until WordPress 2.2 it was interpreted mostly as server time.
Starting with WordPress 2.2 this field is GMT and dates should be offset correctly.
Unfortunately WordPress 2.2.1 introduced a `Z` in the date format which breaks Ruby 1.8.2’s XML-RPC parser — so if you use WordPress 2.2.1 then you need to update your installed Ruby version. If you have [MacPorts](http://www.macports.org/) installed then you can run `sudo port install ruby` and update your PATH. See [RubyVersionIssues](../Troubleshooting/RubyVersionIssue "Troubleshooting / RubyVersionIssue — TextMate Wiki") for help with that.
Even more unfortunately, the next version of WordPress will revert its date handling to before 2.2 and so, after that release, dates will again use the wrong offset.
Note: you may have to change `/user/local/lib/ruby/1.8/xmlrpc/client.rb` if you are not using the default install of ruby that is bundled with OS X. The starting line number for this file is 558.
This seems to be a bug in the XML-RPC support of WordPress. A workaround is to disable the size check in Ruby’s XML-RPC support library. This is done by commenting line 547-552 in `/usr/lib/ruby/1.8/xmlrpc/client.rb`. Note that if you do not have the stock Ruby (from Mac OS 10.4.8) then the line numbers might not be as stated above. The following lines are those you want to disable:
This seems to be because WordPress does not send a length header with its reply, but Ruby’s XML-RPC library expects it.
A workaround is to comment line 547-552 in `/usr/lib/ruby/1.8/xmlrpc/client.rb`. If you do not have the stock Ruby (from Mac OS 10.4.8) then the line numbers may differ from what’s stated above. The following lines are those you want to disable:
- Wrong Size Exception
Some users get an error like the following:
Received exception:Wrong size. Was 1275, should be <unknown>
This seems to be a bug in the XML-RPC support of WordPress. A workaround is to disable the size check in Ruby’s XML-RPC support library. This is done by commenting line 547-552 in `/usr/lib/ruby/1.8/xmlrpc/client.rb`. Note that if you do not have the stock Ruby (from Mac OS 10.4.8) then the line numbers might not be as stated above. The following lines are those you want to disable:
expected = resp["Content-Length"] || "<unknown>"
if data.nil? or data.size == 0
raise "Wrong size. Was #{data.size}, should be #{expected}"
elsif expected.to_i != data.size and resp["Transfer-Encoding"].nil?
raise "Wrong size. Was #{data.size}, should be #{expected}"
end
You now can specify dates like this (note the time zone):
**Note:** Without the patch, the XML-RPC reply of Wordpress contains the post date as it appears on the post's page. This date, however, lacks time zone information. Thus the Blogging bundle interprets this as a GMT date and over-adjusts for the computer time zone. The patch fixes this by actually converting the date to GMT before sending it via XML-RPC.
You now can specify dates with time zone information:
- Specifying Date Created
If you are in a time zone other than GMT and want to specify post dates, do the following:
1. Set TextMate's environment variable `TM_SEND_DATE_TO_WP` to a value of `YES`. You can add and edit it in *Preferences > Advanced > Shell Variables*. 2. Download this [patch file](http://martinwinter.com/downloads/wp-xmlrpc-mw-gmt-patch). 3. Download or copy the file `xmlrpc.php` from the root folder of your Wordpress installation. 4. Make sure that both the patch file and the PHP file are in the same location on your computer. 5. Open the Terminal, navigate to where you put the two files, and type the following command:
patch < wp-xmlrpc-mw-gmt-patch
5. Your `xmlrpc.php` file will have been patched. Upload or copy it to the root folder of your Wordpress installation, replacing the old version.
You now can specify dates like this (note the time zone):
Date: 2006-11-24 18:36:45 +0100
Also, if you have not done so, please check the time offset in your Wordpress installation under *Options > General > Times in the weblog should differ by*.
- Requirements
- Requirements
- Uploading Images
- Uploading Images
(:markdown:)
- Requirements
The blogging bundle works with WordPress 2.0. It probably does not work with 1.5.
- Uploading Images
If uploading of images doesn’t work, be sure that:
1. Your WordPress system is properly configured to allow uploads (should be enabled by default, but double check) 2. Your web server has write access to the upload directory.
(:markdownend:)