Fire up your terminal and do this;
php --versionmkdir /tmp/source && cd /tmp/source
curl --location -s http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download | tar -zx
curl --location -s http://nl3.php.net/get/php-5.3.15.tar.gz/from/nl1.php.net/mirror | tar -zxInstallation
cd /tmp/source/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 installcd /tmp/source/php-5.3.15/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=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/bin/php-config
make -j6
sudo make installPossible errors
You may encounter a problem during build if some C modules aren’t available. If you get an error like this
error: 'PHP_FE_END' undeclared here (not in a function). You can avoid this by editing the file mentioned in the error message and replace all occurrences of PHP_FE_END with {NULL,NULL,NULL} .
Same thing might happen with function ZEND_MOD_END .
After fixing, issue the commands
make -j6
sudo make installThis should build now.
I have no idea what effect this will have on the end-result, but at least it builds :)
Cleanup
now remove the temporary files
cd ~ && rm -rf /tmp/sourceActivation
Edit your PHP configuration
sudo nano /etc/php.iniif “New file” is shown, please copy php.ini-dist to php.ini and try again. Use google for this one :)
other tutorials tell you to set
enable_dl=onextension=mcrypt.soNow restart your Apache
sudo apachectl restart
in your terminal type
you should see:
Now you’re done!
php --info | grep cryptmcrypt support => enabled
No comments:
Post a Comment