Skip to content

Instantly share code, notes, and snippets.

@gregmolnar
Created September 27, 2012 16:59
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 gregmolnar/3795114 to your computer and use it in GitHub Desktop.
Save gregmolnar/3795114 to your computer and use it in GitHub Desktop.
Plug in mcrypt into PHP on OSX
#!/bin/sh
echo "Downlading libmcrypt" &&
wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz &&
tar xzfv libmcrypt-2.5.8.tar.gz && rm libmcrypt-2.5.8.tar.gz &&
cd libmcrypt-2.5.8 &&
echo "Compiling libmcrypt" &&
MACOSX_DEPLOYMENT_TARGET=10.7 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 &&
rm -Rf libmcrypt-2.5.8 &&
echo "Downlading php" &&
wget http://php.net/get/php-5.3.15.tar.gz/from/uk1.php.net/mirror &&
tar xzfv php-5.3.15.tar.gz && rm php-5.3.15.tar.gz &&
cd php-5.3.15/ext/mcrypt &&
phpize &&
echo "Building mcrypt extension" &&
MACOSX_DEPLOYMENT_TARGET=10.7 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 php-5.3.15 &&
echo "extension=mcrypt.so" >> /private/etc/php.ini &&
echo "All done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment