nBLOG

MovableType with MAMP (OS X)
2005.09.16 11:27 PM
459 words

TOPIC(S)
MovableType with MAMP (OS X)
2005.09.16 11:27 PM

NOTICE: CONTENTS OUTDATED

The MAMP+MT implementation process today differs drastically from the time this tutorial was first posted. I suggest checking the comments for a link of a possible updated tutorial from another user.

I tried installing MovableType locally in my laptops webserver (OSX), but ran into some snags. It turns out that there are non built-in perl modules required for it to access the MySQL database. What made it worse is that I was running MAMP and not the normal Apache webserver bundled with the OS.

I figured I’d write this for those users planning to do the same thing… and of course the ever persistent reason of “for my future reference.”

First a couple of preliminary facts: the MySQL is not activated by default… it isn’t even configured. Unlike Apache, which can be launched via System Preferences, the MySQL server has to be started via Terminal (well, at least, that’s what I had to do).

MAMP1 solves that problem because it was meant to be self-contained by design. Meaning every component you would usually have for dynamic publishing, is already included and pre-configured. Unfortunately, this is a very broad area to cover, so MAMP only deals with the most common stuff people need, and can’t really be expected to have any other special modules installed by default.

Before everything else, now is a good time to install the Developer Tools included in your OSX CD, you need this to compile and install the Perl modules you’ll need for MT-MySQL access.

It is to be noted that Perl support isn’t enabled by default in MAMP so make sure to configure your httpdconf file to enable it. Just uncomment the line (take out the #) where it says:

AddHandler cgi-script .cgi

Once you’ve done that, visit this URL http://www.cpan.org/modules/by-category/07_Database_Interfaces/DBD/

Download these latest (or not) versions of these two files (where x are numbers):

  • DBI Module (filename is DBI-X.XX.tar.gz)
  • DBD::MySQL module (filename is DBD-mysql-X.XXXX.tar.gz)

Extract both of these files in /Library/Perl

To install the DBI module, do this (again x is a number):

cd /Library/Perl/DBI-X.XX

sudo Perl Makefile.PL sudo make sudo make install

To install the DBD::MySQL module, it’s pretty much the same with one nuance.

cd /Library/Perl/DBD-mysql-X.XXXX

sudo Perl Makefile.PL –mysqlconfig=/Applications/MAMP/bin/mysql4/bin/mysqlconfig sudo make sudo make install

Notice the extra parameters in one line – this is precisely because we are on a MAMP environment, and you have to explicitly point it there, else it wont compile properly. Of course the actual path of --mysql_config= would depend where you put your MAMP folder.

Once both have been installed, you can delete the folders where you extracted them to. Because the installed modules should now be located in a folder resembling /Library/Perl/X.X.X/darwin-thread-multi-2level (at least that’s where it put mine)

That’s it! You’re now ready to use MovableType locally on your machine with MySQL support ;)

    1. Macintosh, Apache, MySQL, PHP

7 Responses
post a comment Email author at October 5, 2005 10:46 pm, sauo said:

Hello. Thanx for nice tut but id didn’t work for me….. Are you sure about the DBD::MySQL module and this code?:

cd /Library/Perl/DBI-X.XX

sudo Perl Makefile.PL –mysql_config=/Applications/MAMP/bin/mysql4/bin/mysql_config sudo make sudo make install

I have an error which says: “Can’t locate DBI/DBD.pm in @INC” :( Any help?

post a comment Email author at October 6, 2005 6:54 am, webmaster said:

Oooooh, sorry I noticed that I made a mistake in the Tut, notice the line cd /Library/Perl/DBI-X.XX is for the DBI module (I forgot to edit it to reflect the DBD::MySQL module). Basically you have to navigate to the said module you’re trying to compile (where you extracted DBD::MySQL).

The reason it won’t compile is because it’s trying to recompile the DBI module, when it should be the DBD::MySQL ;)

I’ll edit the post, sorry for the inconvenience and hope the corrections work for you.

post a comment Email author at December 6, 2006 1:54 am, FLYCUB said:

Hello and thanks a lot for sharing your experience. I’m trying to put together the same set-up on my MacBook but I’m having trouble with DBD:mysql.

I’ve followed your instructions — it worked fine with DBI, but DBD::mysql install doesn’t go thru.

sudo Perl Makefile.PL –mysql_config=/Applications/MAMP/bin/mysql4/bin/mysql_config

specified mysql configuration script ‘/Applications/MAMP/bin/mysql4/bin/mysql_config’ doesn’t exist.
Please check path/permissions. Will try to use default mysql_config
script found through PATH.
Can’t exec “mysql_config”: No such file or directory at Makefile.PL line 454.

Any idea on what I did wrong ? Thanks again.

post a comment Email author at December 6, 2006 8:06 am, Carlo said:

Flycub,

I just installed XCode tools (and all other developers included on the installer) on my MacBook Pro (the tutorial was made during my Powerbook days) and tried everything out. Doing the exact same process seems to be working. I couldn’t replicate your problem, so I can’t really suggest anything that will solve it.

But the error suggests a mismatch in the PATH of the said file. The only thing I can think of is that you probably have MAMP in a directory OTHER than /Applications (/Users/<USERNAME>/Applications perhaps?)

post a comment Email author at December 13, 2006 10:09 am, Lucian said:

I found my mysql_config file in /Applications/MAMP/Library/bin. Ran the Perl Makefile…seemed like it worked. But somehow make gives me a ton of errors.

post a comment Email author at January 1, 2007 2:20 am, reed said:

The current version of MAMP (MAMP 1.4.1) dows not have the mysql_config file where you’re tutorial says. I tried to change the line to:

sudo Perl Makefile.PL –mysql_config=/Applications/MAMP/Library/bin/mysql_config

But it failed with the DBD-mysql-4.00 I downloaded from CPAN.

Any ideas?

Reed

post a comment Email author at May 10, 2007 10:12 pm, Ian said:

Just for reference the follow up to this article with a working fix (after MT and MAMP have changed their directory structures) can be found here:

http://tribolum.com/archives/2006/12/13/movabletype_on_.php

I’ve tried and tested it and successfully managed to get it working.

Probably Related
356 words
I’m in the process of taking the Tiger plunge. Right now I’m taking my time (better safe than sorry) backing everything up. For those of…
1216 words
Now that it’s been a while since the blog started being powered by WordPress, I figured it was the time to do a comparison of…
1354 words
I’ve updated a bunch of stuff in the last 48 hours. Namely: MovableType Ecto iTunes QuickTime MovableType being the focus of this post. But some…
499 words
I was messing with my font collection so I could check out Extensis’ Suitcase X1 (pronounced “eleven”). I ended up moving so much fonts around…
1731 words
Ubuntu @ 1440×900 resolution in Parallels I’ve installed Ubuntu 6.10 and thought I’d give some input on it. Bugs and Caveats Allocate 512MB RAM Now…
Same day, different year
210 words
While working yesterday, I rebooted to this: After isolating the problem (as you saw from the video), I felt compelled to do something about it.…
61 words
Looks Like Jeline was right, I’m now engrossed in Philip Pullman’s “His Dark Materials” trilogy. I’m currently listening to the second book “The Subtle Knife.”…
38 words
From Goyok’s blog Who Would Bang U??(4 boys) by MoNkEeLiCi0uSUsername/NameShe Wants To Bang UThis Many Times721Quiz created with MemeGen! Ummm, sure – why not? You…
1237 words
There were a lot of cool comments on my previous post on politics (from like 3 people hahahaha) But really though there were little who…
2324 words
Ok, here’s my lowdown of the Canon EOS 20D There have been arguments that it’s more like a baby MarkII rather than a successor to…