[Editing the original post for Google: the solution is at the bottom!]
Why is it that it only took about an hour to get Movable Type Open Source installed and running on my WinXP machine, but took hours to figure out how to get it to work on my Mac?
Here goes:
I’m using XAMPP installed on Leopard. WordPress works fine when I use XAMPP, so I ran it to install Movable Type Open Source 4.1 .
But when I ran the MT wizard, the Perl module for MySQL didn’t register (although all the required modules are there), so I couldn’t choose MySQL during the database configuration.
I used CPAN to try and install DBI and DBD::MySQL, but I got this error when it tried to run the Makefile:
Checking if your kit is complete...
Looks good
Using DBI 1.52 (for perl 5.008008 on darwin-thread-multi-2level) installed in /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/auto/DBI/
Writing Makefile for DBD::mysql
-- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
After hours of Googling I tried using Fink, but while the packages downloaded and installed properly, the MT installation still stalled. So I got rid of Fink.
Another solution suggested creating symlinks (from XAMPP’s MySQL install to /usr/bin/), after which I ran Makefile.PL from the .cpan build directory and it went okay, until I tried “make” and got this:
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -c -I/sw/lib/perl5/5.8.8/darwin-thread-multi-2level/auto/DBI -I/sw/include/mysql -fomit-frame-pointer -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3 -DVERSION=\"4.006\" -DXS_VERSION=\"4.006\" "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE" dbdimp.c
dbdimp.c: In function ‘mysql_dr_connect’:dbdimp.c: In function ‘mysql_dr_connect’:
dbdimp.c:1538: error: ‘ulong’ undeclared (first use in this function)
dbdimp.c:1538: error: (Each undeclared identifier is reported only once
dbdimp.c:1538: error: for each function it appears in.)
dbdimp.c:1538: error: syntax error before numeric constant
dbdimp.c:1540: error: syntax error before numeric constant
dbdimp.c:1654: error: syntax error before numeric constant
dbdimp.c:1538: error: ‘ulong’ undeclared (first use in this function)
dbdimp.c:1538: error: (Each undeclared identifier is reported only once
dbdimp.c:1538: error: for each function it appears in.)
dbdimp.c:1538: error: syntax error before numeric constant
dbdimp.c:1540: error: syntax error before numeric constant
dbdimp.c:1654: error: syntax error before numeric constant
dbdimp.c: In function ‘mysql_describe’:
dbdimp.c:3252: warning: assignment from incompatible pointer type
dbdimp.c: In function ‘mysql_describe’:
dbdimp.c:3252: warning: assignment from incompatible pointer type
lipo: can't open input file: /var/folders/C8/C8LGuPXHEh4ps4Lyk6fJgE+++TI/-Tmp-//ccVwhBoA.out (No such file or directory)
make: *** [dbdimp.o] Error 1
After a few hours of Googling more, I got to this page that provides the solution! I ignored it at the beginning because it specified “MacBook Pro” and “Tiger,” but I blindly followed the commands, and it compiled and installed! But as he mentions, “make test” fails, and that was a problem, and the MT install still couldn’t find DBD::mysql.
So I also had to do what one of the commenters suggested:
Running make test revealed ‘libmysqlclient_r.15.dylib’ was not being found – an extra ‘mysql’ directory was still in the path.
My quick and dirty fix (and to save my sanity) involved manually creating a ‘mysql’ directory in /usr/local/mysql/lib and copying the .dylib file to it.
So I just did the same thing, except in my case I had to copy the file libmysqlclient.15.dylib (no _r suffix). So you run make test and figure out what file isn’t being loaded, and copy that into a new mysql directory in /usr/local/mysql-xxx/lib. Use sudo as needed.
After that I restarted XAMPP and went back to mt.cgi, which was able to find DBD::MySQL!!!
And then MT couldn’t find the mysql socket, so I had to click “Advanced configuration” and copy in “/Applications/xampp/xamppfiles/var/mysql/mysql.sock” for the socket. And then I had to create a new database for MT to find – I guess it doesn’t create the database itself.
And now I can run MT on my Mac. Woohoo!
Now if only I could remember why I wanted to run MT in the first place =P