Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X

Installing MCRYPT for AMPPS 3.9 on Mac

I ran into this issue when some of the applications I have built with CodeIgniter 3.0 will not work in AMPPS 3.9. I noticed the MCRYPT was not installed by default unlike other version.

I have to manually install the MCRYPT. It is not so easy getting the information online but I was able to crack it using the following steps

  1. Download the Tarball of MCRYPT from here https://pecl.php.net/package/mcrypt (I personally downloaded Version 1.0.1 for my PHP version 7.3)
  2. Extract the Tarball and go to your terminal.
  3. Change directory to where the extracted folder is using 
    cd ~/Downloads/mcrypt-1.0.3/mcrypt-1.0.3/
    phpize
    ./configure
    make && make install

     

You might have a little issue with your Mac not pointing to the right PHP installation. You can know which PHP installation your terminal is pointed to by typing this on your command line

which php

If your terminal is pointed to /usr/local/php5/bin/php it will be better you change the path to your AMPPS PHP version Path by doing below

sudo vim ~/.bash_profile

Press key i to start editing the bash_profile file. Type this inside it if it is not there before

export PATH="/Applications/Ampps/php-7.3/bin:$PATH"

If you have a PATH to your PHP before you can comment it out by using #

#export /usr/local/php5/bin:$PATH

Exit VIM by pressing esc + wq + ENTER. Now you should be back at your terminal, type this to load your new settings

source ~/.bash_profile

You can go back to run your code again and see it perform magic. Thanks for reading through.

 


comments powered by Disqus