Installing PHP Extension Mcrypt on Mac OS 10.7

Today I needed to install the Mcrypt PHP Extension on my Mac running OS 10.7 and PHP 5.4.10.  I had to piece together directions from a number of sites and so I’m outlining them here in case anyone else finds this useful:

1. Make a new directory called “mcrypt”

2. Download mcrypt from here

3. Download the php binary file for the php version you are running

4. Move both of these unzipped downloads to the “mcrypt” folder you created

5. Open Terminal, type:

 cd libmcrypt-2.5.8 
 ./configure 
  make 
  sudo make install 

6.  Libmcrypt is now configured but now it’s necessary to make the mcrypt extension

7. In Terminal:

 cd ../php-5.4.10/ext/mcrypt  
 /usr/bin/phpize 

8. You should see:

</p>
<p>Configuring for:</p>
<p>PHP Api Version: 20100412<br />
Zend Module Api No: 20100525<br />
Zend Extension Api No: 220100525 

9. Type:

 ./configure 
 make  
 sudo make install  

10. You should see:

</p>
<p>Installing shared extensions:     /usr/lib/php/extensions/no-debug-non-zts-20100525/ 

11. Open you php.ini file and add the following line:

 extension=mcrypt.so 


That’s it!

 

Sorry, Comments are Closed.

You'll have to take it up with the author...