Enabling Movable Type API on Hostgator (and possibly other shared servers)

| No Comments | No TrackBacks
This is a sort of reminder to myself, but took ages to track down on the web so I might as well post it in case anyone else struggles.

I decided to try external blog editors such as MarsEdit and iBlogger but couldn't get them to work - constant 500 server error. Eventually I got to the bottom of this.
When ever I attempted to access the mt-xmlrpc.cgi file I got a server 500 error. The server logs didn't give many clues. At first I thought it was a failure for the script to be executed, since the MT4 installation directions indicate that much of MT4 should be installed under the main cgi-bin directory, which for some reason I hadn't. Despite this, all of the regular .cgi stuff seemed to work. However, I tried moving all mentioned files to the correct place.

Still had problems - it turns out that my host doesn't have some optional Perl modules installed that are required for the API, SOAP::Lite and LWP:UserAgent. My host does allow these to be installed locally, but the local installation is not in the default Perl path. So it is also required to add:

my $homedir = ( getpwuid($>) )[7]; my @user_include; foreach my $path (@INC) { if ( -d $homedir . '/perl' . $path ) { push @user_include, $homedir . '/perl' . $path; } } unshift @INC, @user_include;

to the top of any of the MT .cgi files that need extra modules. In my case I added this to the mt-xmlrpc.cgi file just after

use strict; my $MT_DIR; sub BEGIN {

I hope that helps someone.


No TrackBacks

TrackBack URL: http://www.gumbrell.com/cgi-bin/mt4/mt-tb.cgi/57

Leave a comment

About this Entry

This page contains a single entry by David published on December 25, 2008 1:19 PM.

Moving modules was the previous entry in this blog.

Vacuuming is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.