How to install mcrypt extension on mac os x yosemite (10.10)

I upgraded my Mac OS X to Yosemite, but I do this to write the whole environment of my dev. So, in order to run Laravel 4 on my local apache, I need to install the Mcrypt extension, but all that I tried, I fail. Even the steps that worked on OS X Mavericks (10.9)

Does anyone have the same problem? Thanks in advance.

Greetings

+7
laravel mcrypt macos
source share
4 answers

I just installed it right now on my Mavericks installation using homebrew and it worked surprisingly well. I can’t say if he will work so well in Yosemite, but it’s worth taking a picture.

Homebrew

brew install autoconf brew install mcrypt 

Macports

  • Check PHP Version

     php -v 
  • Update Macports

     sudo port -v selfupdate 
  • Download and install the appropriate version.

     sudo port install php55-mcrypt 

    now a fictitious proof of this.

  • Find where Macports places the mcrypt.so file and copies it to all instances of the /php/extensions/no-debug-... folder. If you have this directory structure in several places, copy it to all of them. Therefore, each php / extensions / no-debug .. folder on your computer has a copy of mcrypt.so

     sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20090626/ 
  • Determine where your php.ini file is located and make sure that it is actually used, because you can have this file in more than 1 place. Do this to all php.ini files you find.

    Inside this file, find and uncomment the next line. If he commented on this, uncomment him. If it is not in the file at all, add it. In my default php.ini file, I found this on line 536:

     extension=mcrypt.so 

Compile

  • Download mcrypt

     curl -O http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz 
  • Reveal it

     tar -zxvf libmcrypt-2.5.8.tar.gz 
  • Configure, build and install

     ./configure && make && sudo make install 
  • Download Autoconf

     curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz 
  • Reveal it

     tar xvfz autoconf-latest.tar.gz 
  • Configure, build and install

     ./configure && make && sudo make install 

Apache

No matter what method you used to install it. You should always restart Apache when you are done.

  • Restart apache

     sudo apachectl restart 
+7
source share

I just did this and installed. MAMP etc. Not installed.

 brew tap josegonzalez/homebrew-php brew install php55-mcrypt 

And, strangely enough, I had to reinstall it so that it was installed correctly.

 brew reinstall php55-mcrypt 

However, it also reinstalled PHP5.5 from the source code, but it doesn't matter, everything works fine on my end.

+2
source share

I had the same problem. But I use MAMP for my local development. So, I just needed to symbolize the php file before the MAMP version, and everything works.

If you use homebrew, try reinstalling or restarting php install.

I'm sure I can help you get back and work, so just let me know if that doesn't help.

+1
source share

Install libtool from homebrew first, which is a dependency in 10.10 Yosemite

 brew reinstall libtool --universal && brew unlink libtool && brew link libtool 

Then cd to your php directory

 cd /usr/local/php5 

And to the php.d directory

 cd php.d 

Then finally take a quick look to see which extensions you are using:

 ls -l 

If you see duplicate entries containing "mcrypt", you will need to open one of them and comment out the line:

 extension=mcrypt.so 

to

 ;;extension=mcrypt.so 

But only in one of them. For me it was mcrypt.ini. So..

 sudo nano mcrypt.ini 

added a line and did!

+1
source share

All Articles