Skip to content

Instantly share code, notes, and snippets.

@ryanjbonnell

ryanjbonnell/gist:5306629

Last active Dec 15, 2015
Embed
What would you like to do?
Install PHP Mcrypt on Mac OS X 10.8 "Mountain Lion"
# Download PHP 5.3.15 Source
cd /usr/local/src
curl -L -O http://us.php.net/get/php-5.3.15.tar.gz/from/us1.php.net/mirror
tar -xzvf php-5.3.15.tar.gz
# Download libmcrypt
cd /usr/local/src
curl -O http://iweb.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar -xzvf libmcrypt-2.5.8.tar.gz
cd 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
# Make PHP Extension
cd php-5.3.15/ext/mcrypt
phpize
./configure
make
sudo make install
# Edit PHP Configuration
sudo nano /etc/php.ini
extension=mcrypt.so
# Restart Apache
sudo apachectl restart
# Verify Installation
php --info | grep crypt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment