Skip to content

Instantly share code, notes, and snippets.

@ryanjbonnell
Last active December 15, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanjbonnell/5306629 to your computer and use it in GitHub Desktop.
Save ryanjbonnell/5306629 to your computer and use it in GitHub Desktop.
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