Installing Mcrypt Extension for PHP on Osx Mountain Lion

Mcrypt PHP extension required on Mac OS X

Steps

I solved this by running the following commands

brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
php --version // To Test your php
sudo composer update


Result

No more Mcrypt warning !!

Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Generating optimized class loader

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

I just installed it right now on my Mavericks installation using homebrew and it worked surprisingly well. Can't say whether or not it will work so well on Yosemite but worth a shot..

Homebrew

brew install autoconf
brew install mcrypt

Macports

  1. Check PHP version

    php -v
  2. Update Macports

    sudo port -v selfupdate
  3. Download & install the appropriate version..

    sudo port install php55-mcrypt

    now dummy proof it..

  4. Find where Macports put the file mcrypt.so and copy it to all instances of /php/extensions/no-debug-... folder. If you have that directory structure in multiple places, copy it to all of them. So every 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/
  5. Determine where your php.ini file is and make sure it's the one your actually using because you may have this file in more than 1 place. Do this to all php.ini files you find..

    Within that file find and uncomment the following line. If it's commented out, uncomment it. If it's not in the file at all, add it. In my default php.ini file I found this on line 536:

    extension=mcrypt.so

Compile

  1. Download mcrypt

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

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

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

    curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
  5. Uncompress it

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

    ./configure && make && sudo make install

Apache

Regardless which method you used to install it. You should always restart Apache when your done.

  1. Restart Apache

    sudo apachectl restart

Problems with installing mcrypt support for php54 using Homebrew on Mountain Lion

Well, after much trial and error, I solved the issue.

I first had to uninstall php54-mcrypt again to remove the --without-homebrew-php flag and reinstall it with support for the php version installed by homebrew.

$ brew uninstall php54-mcrypt
Uninstalling /usr/local/Cellar/php54-mcrypt/5.4.11...
$ brew install php54-mcrypt
...
==> Summary
/usr/local/Cellar/php54-mcrypt/5.4.11: 3 files, 56K, built in 33 seconds

Then, I edited my httpd.conf file and changed the location of php. I just commented out the system PHP and added a new line to the LoadModule directives to the PHP installed through Homebrew.

#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php5_module /usr/local/Cellar/php54/5.4.11/libexec/apache2/libphp5.so

I then installed phpmyadmin through Homebrew with

brew install phpmyadmin

Then I added the following to the bottom of httpd.conf

Alias /phpmyadmin /usr/local/share/phpmyadmin
<Directory /usr/local/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

I made any changes I need to make in the homebrew installed php.ini located at /usr/local/etc/php/5.4/php.ini and modified the configuration file for phpmyadmin located in /usr/local/share/phpmyadmin/config.inc.php.

I then restarted apache using sudo apachectl restart

All is good to go!

Installing mcrypt on OSX 10.8.2 - PHP 5.3.15 with homebrew

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

Trouble Installing mcrypt library on Mavericks (10.9)

For reference of others finding this thread..

Here is an automated Mcrypt installer for 10.8 and 10.9.
http://topicdesk.com/downloads/mcrypt/mcrypt-download

Less than a minute to install this way.



Related Topics



Leave a reply



Submit