January 26, 2020

Emojis on MovableType! 😎

Emojis are so ubiquitous today that it's hard to believe that they have been adopted by Unicode and started appearing in wide use only about 10 years ago. And I have gotten used to them as well and wasn't expecting at all when in the blog post draft instead of, say, 🧟‍♂️  I saw only four question marks. ????. That meant my MT4 install did not support emojis. I had some more fixin' to do. 😞

In particular:

  • I'd require a Perl version which supports Unicode, and preferably recent version, with up to date Unicode support. Fortunately, I have updated to Perl 5.26, and it supports Unicode 9.0. 🎉
  • MySQL database should be configured to use UTF-8... And that's where trouble starts, since apparently `utf8` does not mean what you think it means, and you have to use `utf8mb4` character set (and `utf8mb4_unicode_ci` collation) to make emojis specifically and newer Unicode in general work. 😒 Easiest way to change character encoding and collaction for the whole mt database for me was export, edit SQL file, and re-import process. It was also a good opportunity to do other updates, such as switch from MyISAM to InnoDB engine. ✨
  • Lastly, it seemed that MT4 itself was already supporting Unicode. Looks like that support was not 100% correct, but I was hoping it should be enough for my needs... Not quite, there was one more step: MT's database connection had to be now configured to use `utf8mb4` instead of `utf8`, and I've added `SQLSetNames 1` line to the `mt-config.cgi` file for the good measure.
  • While making all these changes, I've also noticed that MT4 setup might be in need of some hardening, and disabled some extra scripts.

Result? Complete success! 🚀

Posted by Vadim at 2:05 PM | Comments (0) | TrackBack

January 12, 2020

Updating MovableType

Picking up where I've left off. While MT5 runs on Perl 5.20 well enough, it wouldn't be a good idea to stay on unsupported version for long, so for the next step, I've though to udpate to the currently installed version, Perl 5.26. After a bit of trial and error, it was much easier than I thought, it had required only a couple of changes to the CMS.pm file, and an update to the URI::Escape.

For the good measure, I've updated Data::ObjectDriver module, and put all that up on GitHub, in case someone else is looking to make his MovableType install run on current environment.

Posted by Vadim at 5:40 PM | Comments (0) | TrackBack

January 5, 2020

MovableType Lives On

What do you know, you don't post a decade or so, and things stop working for no reason? I've noticed recently that MovableType 4.12 install I had here was no longer working, oh, since about April 2018 or so, and so I have decided to have a look and see what is going on and figure out what is needed to make it run again.

I started looking for error logs first, and quickly found out that my provider no longer keeps error logs for shared hosting plans at all. When that became a feature reserved for private hosting? Packed everything I did and moved to another webhost. Good bye, 1&1, and no thanks, Ionos.

With error logs access and CGI running on a new host, my next discovery was that Perl was not standing still all these years, either. MT4 no longer can be run on the current version of Perl (5.26 at the moment), and wouldn't run even on earlier versions as there has been several changes to the language syntax. Even the latest release, MT5.2.13, which is still available for download and availabe in its entirety from this GitHub repository, wouldn't run on Perl 5.26. Changes to regexp syntax introduced in Perl 5.22 as warnings now fail starting with Perl 5.24 and later. So it's either updating MT5's code to run on Perl 5.26, or installing Perl 5.20.

Since I don't have much real life experience with Perl hacking, I've decided to start with an easier path. Installing Perl. There are even easy to follow guides available on the web to make this process a breeze. Except that, in addition to Perl itself, there are a few more steps:

  • Edit ever CGI script (11 total) to change #! to point to the custom Perl install;
  • Install DBI package;
  • Install DBD::mysql package;
  • Install Devel::CheckLib package.

That last one was tiny. And I also had to muck around with user permissions... MT upgrade script haven't given me permissions for the site it has automatically created. How odd!

... and, how the saying goes, Bob's your uncle!

Posted by Vadim at 5:37 PM | Comments (0) | TrackBack