Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/sh
# Scipt for installing mcrypt.so extension for PHP 5.3.13 (default PHP for OS X 10.8 Mountain Lion)
mkdir /tmp/mcrypt
cd /tmp/mcrypt
curl --location --progress-bar http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download | tar -zx
curl --location --progress-bar http://us.php.net/get/php-5.3.26.tar.gz/from/us.php.net/mirror | tar -zx
cd /tmp/mcrypt/libmcrypt-2.5.8
MACOSX_DEPLOYMENT_TARGET=10.8 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --disable-dependency-tracking
make -j6
sudo make install
cd /tmp/mcrypt/php-5.3.26/ext/mcrypt/
phpize
MACOSX_DEPLOYMENT_TARGET=10.8 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/usr/bin/php-config
make -j6
sudo make install
cd ~ && rm -rf /tmp/mcrypt
echo "Don't forget to add 'extension=mcrypt.so' to /etc/php.ini"
@eightamrock

This comment has been minimized.

Copy link
Owner Author

commented Oct 20, 2013

Updated for OSX 10.8.5 and PHP 5.3.26

@maikelmclauflin

This comment has been minimized.

Copy link

commented Dec 30, 2013

hi, i'm trying to use this to install mcrypt, but right after I sudo make install at the end, I get this error

Making install in modules
make[1]: *** No rule to make target `install'. Stop.
make: *** [install-recursive] Error 1

do you know what this may be referring to / what I can do?

@phillpafford

This comment has been minimized.

Copy link

commented Jan 14, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.