perlmovabletype

Movable Type: Can't locate object method "new" via package "HTTP::Request


I am stuck on the last open source version of the blog software Movable Type before Movable Type went back to being a paid/professional offering only.

My host recently updated the Debian OS version and it apparently came with a more up-to-date version of Perl.

After the update, I am now getting the following error (specifically when Movable Type attempts to generate a Trackback, and I do need internal Trackbacks on my site):

Can't locate object method "new" via package "HTTP::Request" at /home/super/www/www/cgi-bin/mt512/extlib/HTTP/Request.pm line 14.

The code on the line 14 in question is

my $self = $class->SUPER::new($header, $content);

A larger snippet of the code from Request.pm, from the top of the file, is below.

I unfortunately don't know Perl. But I am hoping someone might be able to tell me if there is a relatively easy way to address this.

package HTTP::Request;

require HTTP::Message;
@ISA = qw(HTTP::Message);
$VERSION = "5.827";

use strict;



sub new
{
my($class, $method, $uri, $header, $content) = @_;
my $self = $class->SUPER::new($header, $content);
$self->method($method);
$self->uri($uri);
$self;
} 

Update: With help from Jay Allen, I was able to run mt-check.cgi

The check says that LWP::UserAgent is not installed:

mt-check

According to my site's Installed Perl 5 modules list, though, it is installed:

LWP UserAgent

I don't know if it's helpful, but there's also a CPAN::LWP::UserAgent:

CPAN user agent

Per Jay's original comments, I confirm that the MT cgi files begin with:

#!/usr/bin/perl

Here is the system information from mt-check:

Operating system: linux

Perl version: v5.24.1

Perl include path:

plugins/Textile/lib

plugins/FormattedTextForTinyMCE/lib

plugins/FormattedText/lib

plugins/Minifier/lib

plugins/MultiFileUploader/lib

plugins/spamlookup/lib

plugins/FacebookCommenters/extlib

plugins/FacebookCommenters/lib

plugins/Approval/lib

plugins/CommentRating/lib

plugins/WXRImporter/lib

plugins/TinyMCE/lib

plugins/mixiComment/lib

plugins/CustomFieldsSearch/lib

plugins/feeds-app-lite/lib

plugins/StyleCatcher/lib

plugins/WidgetManager/lib

plugins/EmailRetitler/lib

plugins/TypePadAntiSpam/lib

plugins/NotifyWho/lib

plugins/Profiler/lib

addons/Community.pack/lib

addons/Commercial.pack/lib

extlib

extlib

lib

/etc/perl

/usr/local/lib/i386-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1

/usr/lib/i386-linux-gnu/perl5/5.24 /usr/share/perl5

/usr/lib/i386-linux-gnu/perl/5.24 /usr/share/perl/5.24

/usr/local/lib/site_perl /usr/lib/i386-linux-gnu/perl-base .

Web server: Apache

(Probably) running under cgiwrap or suexec


Solution

  • Movable Type includes a lot of non-compiled CPAN libraries in your extlib directory. The idea is that this makes it easier for people to run it who can't install modules. Unfortunately, when you upgrade Perl but not Movable Type, those modules mask the proper and necessary ones that are either bundled with the new Perl library or installed by your web host. That is exactly the case with LWP and HTTP:*.

    To solve this, you can rename the following extlib files/directories using your FTP software:

    I usually just tack on -MOVED to the end. Assuming this works, you can delete these files/directories entirely.

    Additionally, there are other libraries which need the same treatment in some later version although I'm not sure which. It may be the one you're using:

    UPDATE: I forgot a few more from that list:

    And it also looks like Perl 5.24 gave us at least one more module to rename or delete from extlib:

    These last two are why LWP::UserAgent is throwing an error when you run mt-check.cgi.