1
votes

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

1
Install the Perl LWP system package. You will probably need more dependencies. It looks like it didn't upgrade the system packages with Perl modules with the system. You can try to run it and search the Debian package website for the Perl module names from the errors to see which packages to install. You can also install the modules from cpan directly, but messing with the system Perl is not a good idea. Typically you'd have a Perl install for your production environment separately from the OS. - simbabque
Unfortunately it seems the LWP system package is already installed. But thank you for your comment. - fnord12
Where is that file you posted located? It might be the mt isn't using your system Perl. Check if you have another one. - simbabque
The file is located in a subdirectory of the cgi-bin: /cgi-bin/mt/extlib/. It doesn't seem like there is another instance of Perl. I don't have direct access, but Perl is in /usr/bin/perl - fnord12
Do you have shell access via SSH or telnet? If so, here are a few things to do to add information to your post: 1) Check that your CGI files (mt.cgi, mt-check.cgi, et al) start with #!/usr/bin/perl and not some other perl, 2) Run that perl with the extended -V flag in order to find out not only the version but also the built-in @INC (/usr/bin/perl -V), 3) Run mt-check.cgi to make sure that it is seeing the proper perl and @INC directories (you'll likely have to temporarily rename/move your mt-config.cgi). Add all of that output to your post minus any server identifying info - Jay Allen

1 Answers

2
votes

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:

  • HTTP/
  • LWP/
  • LWP.pm

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:

  • JSON
  • JSON.pm
  • version/
  • version.pm
  • version.pod

UPDATE: I forgot a few more from that list:

  • Net/HTTP/
  • Net/HTTP.pm
  • Net/HTTPS.pm
  • Params/Validate.pm
  • Params/ValidatePP.pm
  • Params/ValidateXS.pm
  • Params/Validate/

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

  • URI/
  • URI.pm

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