Recently I setup Laravel enviroment on my Macbook, when I create project or run php artisan, it always prompts
Mcrypt PHP extension required. error for me. Becuase I am using vagrant homestead for Laravel development, I can
homestead ssh to run commands, but I think it’s better and convenience for me to install Mcrypt on my local enviroment. Then I did some reseach, and setup Mcrypt with mac native PHP.
There are three ways I found:
- Manually complie Mcrypt source and install
- Using Homebrew to install
- Using MAMP Mcrypt
For my requirement, I think homebrew is the best way for me.
autoconf which is needed when homebrew compling Mcrypt
brew install autoconf
brew tap homebrew/dupes brew tap homebrew/versions brew tap homebrew/homebrew-php
brew install php55
brew install php56
brew install php55-mcrypt
brew install php56-mcrypt
add mcrypt extension into
/etc/php.ini. You can find path using
brew info php55-mcrypt, eg.