Installing mcrypt on OSX 10.8.2 - PHP 5.3.15 with homebrew

牧云@^-^@ 提交于 2019-11-27 14:40:06
pinxi

First check if brew is up-to-date:
brew doctor

Second install mcrypt based on php version:
brew install php53-mcrypt

NB: Step three below is not required on recent versions of brew:

Third open php.ini file and add reference:
sudo vi /private/etc/php.ini
extension="/usr/local/Cellar/php53-mcrypt/5.3.25/mcrypt.so"

Finally, restart apache:
sudo apachectl restart

Matanya

After wondering for hours through different advices, this one worked for me (Installed via MacPorts):

Courtesy of Chris Brewer:

Download and install MacPorts from http://macports.org.

The following steps are performed in the Terminal:

Force MacPorts to update (will only work if Apple's Xcode installed):

sudo port -v selfupdate

Now, install memcached:

sudo port install php5-mcrypt

Copy the newly created shared object for mcrypt into Mac OS X’s default PHP5 extension directory:

sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20090626/

Next, you need to edit php.ini to add the extensions. Find the phrase Dynamic Extensions, and add:

extension=mcrypt.so

And finally, restart Apache:

sudo apachectl restart

I've solved the problem with this

brew install php54-mcrypt --without-homebrew-php

Then I add this line to /etc/php.ini.

extension="/usr/local/Cellar/php54-mcrypt/5.4.24/mcrypt.so"

If this file doesn't exists you'll need to copy it from /etc/php.ini.default. Also I check the version of my php with php -v (And it was 5.4.x)

SteckDEV

I appreciate the work you did on this! This worked for me. I am on a mac and it was looking for xcode. The Developer location hadn't been set so I had to do all of this.

(RESOLVE THE DEVELOPER PATH) How can I resolve "Error: No developer directory found at /Developer"?

  1. sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

(SIGN THE AGREEMENT TO USE XCODE)

  1. sudo xcodebuild -license

Lastly follow the above steps!

This may prove useful...

  1. brew tap homebrew/homebrew-php
  2. brew install php56-mcrypt

Worked like a piece of cake with this.

$ brew install mcrypt
Warning: mcrypt-2.6.8 already installed
$ brew install php55-mcrypt
Warning: php55-mcrypt-5.5.20 already installed

Then test it out:

$ php -m | grep mcrypt
mcrypt

$ php -i | grep mcrypt
Additional .ini files parsed => /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini,
Registered Stream Filters => zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!