Yesterday we upgraded the server that runs www.psesd.org (including this weblog) from Mac OS X Server 10.1 to 10.3. The whole process was a bit of a pain, but there should be some nice benefits, mostly with Apache and its admin tools. But there was one little issue that caused a fair amount of pain (mostly to me). OS X 10.3 has some quirks in its perl installation, and they bit us when trying to get MovableType running.
MovableType uses MySQL to store the weblog posts. MovableType is written in perl, and it needs two perl modules (DBI and DBD::mysql) to access MySQL. "No problem," says I, "I can just install them using CPAN":
perl -MCPAN -e 'install DBI'
perl -MCPAN -e 'install DBD::mysql'
But, the installation fails with an error. After doing some searching, I figure out that the problem is some missing headers for perl. I seem to remember that installing the Apple Developer Tools took care of this on the old server, and some of the pages I found confirm this. But, installing the Dev Tools didn't do it. More searching and I find that Apple has moved the aforementioned headers into the BSDSDK. Okay, so we install those. No dice.
(Oh, and if for some reason you don't want to install the BSDSDK, there are other options for getting the headers.)
Here's where things get fun.
First of all, no more playing around with CPAN's auto-installer. From here on out, its download the modules and compile from source.
My eventual solution combined advice from the following sources:
The MacZealots article pointed out that Apple screwed up its Perl configuration, and it needed to be edited:
sudo pico /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm
Change ld='MACOSX_DEPLOYMENT_TARGET=10.3 cc' to ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc'
This fix allowed me to successfully install DBI (perl Makefile.PL; make; make test; make install).
But, the fix didn't help with DBD:mysql. One of the comments on the Casey West page recommended removing references to '-arch i386' in the Makefile. I did that, and it still didn't work:
Makefile:542: *** missing separator. Stop.
It turns out this was just a linebreak that shouldn't have been there. I don't know why it was there, but removing the break fixed it, and the rest of the installation went normally.
So, I hope this helps others who are working on the same problem. All in all, it was a big pain, and hopefully Apple will make some changes (ship the headers out of the box; fix the perl config) to make this easier in the future.
Posted by Karl
February 4, 2004 03:16 PM