What a pain to get mcrypt installed supporting all the architectures Mac OS X needs. I could only compile with one architecture. I kept getting:
gcc-4.0: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
as well as:
configure: error: Sorry, I was not able to diagnose which libmcrypt version you have installed.
Well, the secret is –disable-dependency-tracking (more info here).
To build libmcrypt-
libmcrypt-2.5.8:
MACOSX_DEPLOYMENT_TARGET=10.5 \ CFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \ LDFLAGS='-O3 -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \ CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \ ./configure --disable-dependency-tracking make -j6 sudo make install
To build the mcrypt extension -
php-5.2.6/ext/mcrypt:
/usr/local/php5/bin/phpize MACOSX_DEPLOYMENT_TARGET=10.5 \ CFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \ LDFLAGS='-O3 -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \ CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \ ./configure --with-php-config=/usr/local/php5/bin/php-config make -j6 sudo make install
mcrypt.so (162Kb MD5: 6801f7ea818954405028eeb68d59a5f6)
Here’s the address to download the extension http://saltybeagle.com/downloads/mcrypt.so
Hi there –
I got libmcrypt to compile just fine with vanilla configure, but mcrypt.so file doesn’t work.
How (and with what source) did you compile it – I keep getting a cannot find config.m4 using mcrypt-2.6.8 source.
I got the extension done using the php source, but get a load error. PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/extensions/no-debug-non-zts-20060613/mcrypt.so’ – (null) in Unknown on line 0
Any thoughts?
Michael,
This guy…
http://www.glenscott.co.uk/tag/php/
… says it is because you are running a 32 big .so on a 64 bit system.
Thanks! This saved me a couple hours and some headache.
Thanks Salty -
I had to set the absolute path in php.ini:
extension=/usr/lib/php/extensions/no-debug-non-zts-20060613/mcrypt.so
Changing extension_dir from “./” to something else didn’t work.
But doing that took down my server and nothing would load. The fix was uncommenting the timezone in php.ini:
date.timezone = “US/Central”
Don’t know why that worked but I had come across it on some site I’ve since lost
Here’s some additional resources:
http://www.glenscott.co.uk/2009/03/16/mcrypt-support-for-php-on-64-bit-mac-os-x-105/
http://discussions.apple.com/thread.jspa?threadID=2219620&tstart=0