Installing Movable Type on a local XAMPP

Install XAMPP, install Strawberry Perl, maybe install DBD::mysql in Perl, reboot!, install Movable Type. Create database, configure everything, then run. Also use NotePad++ and FileZilla.

I cannot run my Movable Type installation for my Harley site on DreamHost. My template files are so gigantic that I keep getting 504 Gateway Timeouts. My Harley site is purely static. No comments, no trackbacks, no interactive content at all. No one else has access to publish but me. So I really don't need Movable Type installed on DreamHost, I can have it here on a Windows laptop. Since you are installing Linux programs in a Windows operating system, there is plenty of suffering to go around.

I finally got it working and its great. When I was using Movable Type on the web, a category page set rebuild took 13:30 minutes, with two "back" buttons to get out of the Gateway timeout. When I ran Movable Type on an old XP box here, the page rebuild took 2:45. With Movable Type running on my Lenovo laptop, the pages build in 1:10.

There is an intriguing mid-way solution. You can run Movable Type locally, but leave the database up on the web. The pages took 42 minutes then, ain't computer science great? So I thought about paying DreamHost for a VPS (virtual private server), $15 or $35 a month. I can't afford a $200-a-month dedicated server. But even if I could get around the gateway timeouts, Movable Type has always been dog slow and it drives me nuts.

So one solution is to just install Linux on a computer, and then Apache and then mysql, then Perl, and then Movable Type. Thing is, I just fear needing a 4-year CS degree to be conversant in Linux.

So the alternate is to use XAMPP, which is a Windows software stack that installs Apache, mysql, PHP, and Perl. After Installing Movable Type, it did not work. Using the mt-check.cgi file, which at least would run, it said there was no DBD::mysql module installed in the Perl program. I tried and tried to install DBD::mysql in XAMPP but if I used ppm (Perl package manager) it failed sisnce it could not find some dll. If I tried CPAN, another installer, it would go get the module, but could not compile since, ta da, there is no Perl complier included in XAMPP.

Short answer is I installed Strawberry Perl, and then did a CPAN install DBD::mysql, and only after a Windows reboot did Movable Type see the module. The detailed misery is below. You can't install DBD::mysql in XAMPP since XAMPP does not appear to have a Perl compiler. I assume that people that don't have my problems are CS majors with 5 or 6 Perl compilers installed and all the Win .NET and all the other good programmer stuff.

I solved the problem by installing Strawberry Perl (64bit). Yes, the 64 bit version. Since I have already wasted two days on this I figured to reach for the moon. At first there was no change in the mt-check.cgi file, still no DBD::mysql module was found. Then I went into the Strawberry Perl CPAN.bat file, and did an install DBD:mysql. It did a lot of chugging and seemed much happier than when I did this in the XAMPP CPAN.bat, where it failed since it could not find Makefile.PL. Still, mt-check.cgi still reported no DBD:mysql module. Then I noticed that some of the Strawberry Perl files, like relocation.txt had 8.3 file-names with a tilde, and if figured that I was back in 1987. So I stopped all the services and rebooted the computer. When it came back, restarted the service in the XAMPP control panel and then mt-check.cgi reported the DBD:mysql module was there. It may have been there all the time, and I should have done the reboot after installing Strawberry Perl, so maybe the whole CPAN.bat was silly. I did choose Strawberry Perl since the DBD::mysql install docs say SP has it bundled.

Oh, I did have to change all the shebangs in the Movable Type .cgi files to point at the perl.exe in the Strawberry Perl sub-directory. Since I have heard Movable Type does not like spaces in path names, I did install Strawberry Perl in C:\Strawberry. Other voodoo I tried that was probably irrelevant was using file explorer to set all the cgi and pl files to open with perl.exe.

So to sum up, installing Movable Type 5.2 Pro on XAMPP 5.6.3:

  1. Download xampp-win32-5.6.3-0-VC11-installer.exe and install in C:/xampp (default I think)
  2. Download strawberry-perl- and install in C:/Strawberry (not default)
  3. If transferring a working Movable Type install from a web server, use FileZilla to sftp the mt (They use MT5.0 or some foolishness, I renamed it) and mtstatic directories from your server.
  4. Move the mt directory to C:\xampp\cgi-bin
  5. Move the mt-static directory to C:\xampp\htdocs
  6. Change all the shebangs in the .cgi files in mt to point at the Strawberry Perl perl.exe, for me that was #!C:/Strawberry/perl/bin/perl.exe -w
  7. If not already, open the XAMPP control center (start>program files>XAMPP) and make sure both Apache and mysql are installed (left checkboxes) and started (those middle checkboxes).
  8. Type localhost in your browser address bar and enter. If you run no-script in Firefox, make sure to enable scripts for http://localhost at the bottom of the page. You may have to click on your language to get to the "real" XAMPP page.
  9. On the left panel, click Tools>phpMyAdmin
  10. Mess with that until you have figured out how to create a new database.
  11. Go back to http://localhost/xampp/ and click Welcome>security
  12. On that page click http://localhost/security/xamppsecurity.php
  13. Give your database a password, Movable Type will not run with an open database.
  14. Almost, hang in there. Edit the mt-config.cgi file with Notepad++ to have database have the same name as the one you just made, and to use the same password as the one you just set. Set CGIPath to /cgi-bin/mt/. Set StaticWebPath to /mt-static/. Set StaticFilePath to C:\xampp\htdocs\mt-static. And you know not to use the periods right, these are sentences, not code.
  15. Now go to your web host control panel and use their phpMyAdmin to export a zip file of the database for your Movable Type. Save it locally.
  16. In http://localhost/xampp/ go back to Tools>phpMyAdmin and select your shiny new database and click the import tab. Browse to the zip you just downloaded. Import the zip file.
  17. Reboot. Yes welcome to Perl, set your watch back 30 years.
  18. Start both the Apache and mySQL services in the XAMPP control panel. Remember, everything is a test, so you have to click on the left two buttons to "install" the services, then go to the middle of the dialog box and click "Start" for both services.
  19. You can verify that localhost in the browser address bar works. Then type in the browser address bar http://localhost/cgi-bin/mt/mt.cgi You should get the Movable Type logon screen. Since you brought the database down from your webserver, the same user and password should work on this local install.
  20. When it doesn't work, and it won't, change the mt-config.cgi file name to anything else, mt-config.cgi-misery is good. Then type http://localhost/cgi-bin/mt/mt-check.cgi in the browser address bar. Now you are back where I was, and you might see that DBD::mysql is not installed. I have assumed you are using a mysql database, so now maybe go into C:\Strawberry\perl\bin\cpan.bat and click it. In the command window type install DBD::mysql. It should chug for a long time, very verbose and seem generally happy, lots of OKs and such. When it is done, type quit.
  21. Reboot
  22. Start up XAMPP Apache and mysql
  23. Try http://localhost/cgi-bin/mt/mt-check.cgi in the browser bar again.
  24. If you have DBD::mysql installed now, you can change the file-name mt-config.cgi-misery back to mt-config.cgi. Then try http://localhost/cgi-bin/mt/mt.cgi good luck.
  25. If and when you did get this local Movable Type running, you need to go in the "Settings>General" of the website or top-level, and point the output files to where you want then to appear. So I left Website URL where it was, but changed Website Root to /Users/Paul/Docs/. The same deal, I don't want spaces in the path names, so I use Docs instead of My Documents. This of course is based on having XAMPP installed right under C:\.

If any single program, Win 7 Pro, XAMPP 5.6.3, Strawberry Perl (64bit), Movable Type Pro 5.2.9 or even FileZilla and Notepad++ is different, none of this is likely to work and no one can help you. Note that you can use the regular ftp on Filezilla if you don't care about security. To use sftp I had to go up to Dreamhost and mess around to set some sftp setting in the domain I think it was. Suffer on soldier, suffer on.

The Step C, profit, part of this for me is that my Movable Type has really large scripts in the category page template so I get 504 Gateway Timeouts from DreamHost. They tell me things are taking to long so they kill the process. I thought about upgrading to a VPS, I sure can't afford a $200-a-month dedicated server, but then I still have a dog-slow Movable Type even if there are enough resources to not have the Gateway timeout.

Note you can point the Movable Type config file to still use the web database. There you have to go to your webhost, and for the user enable the IP address or the incoming address of the request. With the Brighthouse Networks here, that was a string with dashes between my IP address instead of periods and something like concatenated to it.

It turns out my Movable Type is still dog slow when I point it to the web database, so I am stuck with running a local Movable Type with a local database. Not the worse thing in the world, but I have to backup or mirror the database somewhere. My big deal is that its not too hard to set up this local Movable Type to generate HTML pages with the proper URLS and such. I am not running any dynamic content, no comments, no trackbacks no external uses other than me. So I intend to just use this local Movable Type and the sftp the files up to Dreamhost, which will work fine slinging static HTML, even for 9 dollars a month.

[Update} The giant category template file creation that caused 504 Gateway timeout on the Dreamhost Movable Type install ran in 2:45 on my XP box with the old XAMPP and the kludge Perl I managed to get working. The box is a Athlon Thunderbird 4800+. The Lenovo Laptop (i7-3610QM CPU @ 2.3GHz) where I got this install running does the template files in 1:10, over twice as fast. It was worth the two days suffering to get this working.

And one cool-guy thing is you can run the local Movable Type from any computer on your LAN as long as the install box is powered up. Just type the IP address of the install box into the browser address bar and you should get the XAMPP page, then just figure out the paths to do the same mt.cgi file. For this you might want to go into your router and reserve the IP address so your install box will always have the same IP address.

About this Entry

This page contains a single entry by Paul Rako published on March 26, 2015 4:48 PM.

Movable Type text and images on category pages was the previous entry in this blog.

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