Installing Movable Type on XAMPP in a Windows 7 Pro laptop

Vote 0 Votes

This is mostly a cross-post from one I did at the Apache Friends forum, I thought it beneficial to post it here as well.

Since I have very complex category templates, my Dreamhost shared webhosting is choking with 504 Gateway Timeout errors.

DreamHost tells me my scripts are taking too long so their watchdog process is killing them.

They say that a VPS account "might" fix things.

Thing is, Movable Type 5.2 is dog slow on a cheap web host anyway.

I gave up long ago on having comments on my site.

That is what Facebook, and Twitter and LinkedIn are for, or in the case of my Harley website,

And I don't do any dynamic publishing, the whole reason I love Movable Type is that is makes static HTML web pages.

So there is no reason for me to host Movable Type on the web, I can have it here in my living room, and then just upload the files with WinSCP to my website.

There is also a tremendous security advantage, since there is no Movable Type installed on my website.

As I note at the end of this post, there is a half-way solution.

You can leave the mySQL database up on your webhost and still run the Movable Type on your home computer.

It works, I have done it, but for my templates, the page builds ran even slower.

It has a kind of synchronization since if someone used the web MT to do a post, it might not clobber someone doing a local edit.

I think Movable Type would be incapable of reserving identical blog IDs from the two installs, but I might be wrong about that.

So in my mind, if you do leave the database up on a webhost, you should proabably take down the web install of MT.

To install Movable Type on my Win7 laptop, I used XAMPP, which is a cross-platform software stack that gives you Apache web server, a mySQL databse, PHP, and Perl.

Unfortunately, it is not a full Perl installation.

The mt-check.cgi will report that there is no DBD::mysql installed.

I could find no way to install that module in the Perl that comes with XAMPP.

Neither the ppm (Perl package manager) nor the CPAN.bat files worked.

The ppm window hangs with a missing libexpat-1.dll error.

The XAMPP CPAN.bat tries to install DBD::mysql but fails because there is no Makefile.PL installed.

So I did a separate install of the Windows Strawberry Perl.

It seems to work fine.

The details are below.

It seems 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, I restarted the Apache and mySQL services 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.

Maybe the whole CPAN.bat exercise was silly.

I did choose Strawberry Perl since the DBD::mysql install documentation says Strawberry Perl 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: Download xampp-win32-5.6.3-0-VC11-installer.exe and install in C:/xampp (default I think) Download strawberry-perl- and install in C:/Strawberry (not default) 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.

Move the mt directory to C:\xampp\cgi-bin Move the mt-static directory to C:\xampp\htdocs 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 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).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.

On the left panel, click Tools>phpMyAdmin Mess with that until you have figured out how to create a new database.

Go back to http://localhost/xampp/ and click Welcome>security On that page click http://localhost/security/xamppsecurity.php Give your database a password, Movable Type will not run with an open database.

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.

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.

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.


Yes welcome to Perl, set your watch back 30 years.

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.

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.

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.

Reboot Start up XAMPP Apache and mysql Try http://localhost/cgi-bin/mt/mt-check.cgi in the browser bar again.

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.

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 is a different rev, Win 7 Pro, XAMPP 5.6.3, Strawberry Perl (64bit), Movable Type Pro 5.2.9 or even FileZilla and Notepad++, 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.

[Update, I have since tried WinSCP and will use it instead of FileZilla since WinSCP can do the mirroring of the local HTML that this Movable Type makes up to my web host.

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 bbh.

net 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.

It is very hard to synchronize a local and a web mySQL database, so once you use the local Movable Type with the local database, you can't go back to using the web Movable Type.

The only way you might do this is to drop all the tables in your web database and then do an import of the local database.

Very scary stuff.

Note I am not a programmer, so be carefull.

[Update] The giant category template publication that caused 504 Gateway timeouts on the Dreamhost Movable Type install would take about 13:30 minutes when I did get it to run.

On my XP box with the old XAMPP and a kludge Perl, the category pages published in 2:45 minutes.

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 as the XP box, and 10 times faster than the web intallation of Movable Type.

It was worth the two days suffering to get this working.

As I noted, I use WinSCP to synchronize the files between my local box and the webhost.

WinSCP preserves timestamps but also correctly interprets them, unlike my old SynchroMagic Pro.

The response time of Movable Type is the same or better than if you had a $200-a-month dedicated server.

I pay 9 bucks a month and DreamHost does fine since it only serves my static pages.

The speed that Movable Type responds in a local install is intoxicating.

I don't think I could use any web install now.

I don't use thumbnails, but I might even try to install Image::Magick to keep Movable Type from complaining.

This local install is like having a dedicated server.

I should note my hard-core programmer buddies (I am a hardware guy) thought the really cool thing would be to convert that old XP box of mine into a Linux box and then install Apache, mySQL, and Movable Type.

This is probaby the best solution, but I am a Windows guy and it is awefully nice to have the MT install on this Win 7 laptop.

1 Reply

| Add a Reply

Add a Reply

Forum Groups

Movable Type

1 12

Last Topic: Uploading Assets in Entry/Page by Michael Webster on Mar 2, 2015

3 9

Last Topic: Making breadcrumbs by SportsterPaul on May 24, 2017


Be the first to post a topic in this forum


Be the first to post a topic in this forum

Pricing and Licensing

Be the first to post a topic in this forum

Product Ideas

Be the first to post a topic in this forum