Install mcrypt on OSX 10.8.2 - PHP 5.3.15 with homebrew

I have successfully installed mcrypt via homebrew , but I am trying to find the path to mcrypt.so to enable it as an extension in php.ini .

mcrypt was installed in /usr/local/Cellar/mcrypt/2.5.8 . Wood:

 -- AUTHORS |-- ChangeLog |-- INSTALL_RECEIPT.json |-- NEWS |-- README |-- TODO |-- bin | `-- libmcrypt-config |-- include | |-- mcrypt.h | `-- mutils | `-- mcrypt.h |-- lib | |-- libmcrypt.4.4.8.dylib | |-- libmcrypt.4.dylib -> libmcrypt.4.4.8.dylib | `-- libmcrypt.dylib -> libmcrypt.4.4.8.dylib `-- share |-- aclocal | `-- libmcrypt.m4 `-- man `-- man3 `-- mcrypt.3 

I tried to include mcrypt.h in php.ini :

 extension="/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h" 

and then restarted apache. but it didn’t work.

when i run php in terminal i get:

 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h' - dlopen(/usr/local/Cellar/mcrypt/2.5.8/include/mcrypt.h, 9): image not found in Unknown on line 0 
+17
php mcrypt
Jan 16 '13 at 11:16
source share
6 answers

First check if brew is being updated:
brew doctor

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

NB: Step 3 below is not required in recent brew versions:

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

Finally, restart apache:
sudo apachectl restart

+47
May 23 '13 at 19:34
source share

After a few hourly tips, 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 update MacPorts (will only work if Apple Xcode is installed):

 sudo port -v selfupdate 

Now install memcached:

 sudo port install php5-mcrypt 

Copy the newly created shared object for mcrypt to the default directory of the PHP5 extension for Mac OS Xs:

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

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

 extension=mcrypt.so 

And finally restart Apache:

sudo apachectl restart

+22
Jan 16 '13 at 13:24
source share

I 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 does not exist, you must copy it from /etc/php.ini.default . I also check the version of my php with php -v (And that was 5.4.x)

+9
Feb 06 '14 at 0:50
source share

I appreciate the work you have done on this! It worked for me. I am on a mac and it was looking for xcode. The place of the developer was not established, so I had to do it all.

(RESOLVE THE DEVELOPMENT WAY) How can I resolve the "Error: there is no developer directory found in / Developer"?

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

(SIGN AGREEMENT FOR USING XCODE)

  1. sudo xcodebuild -license

Finally, follow the steps above!

0
May 16 '13 at 2:34
source share

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 check:

 $ 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 
0
May 23 '15 at 6:31
source share

This may be useful ...

  • brew click homebrew / homebrew-php
  • brew install php56-mcrypt
0
Oct 11 '15 at 8:47
source share



All Articles