These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.
Install Mcrypt using Homebrew and PECL (comes with PHP)
# PHP 7.3
$ brew install mcrypt
$ pecl install mcrypt-1.0.3
Find your php.ini
:
$ php -i | grep "Loaded Configuration File"
Loaded Configuration File => /usr/local/etc/php/7.3/php.ini
Add this line to your php.ini
:
extension=/usr/local/Cellar/php/7.3.x/pecl/20180731/mcrypt.so
Install Mcrypt using Homebrew
# PHP 7
$ brew install php70-mcrypt
# PHP 5
$ brew install php56-mcrypt --without-homebrew-php
Add this line to /private/etc/php.ini
:
# PHP 7
extension="/usr/local/Cellar/php70-mcrypt/7.0.x/mcrypt.so"
# PHP 5
extension="/usr/local/Cellar/php56-mcrypt/5.6.x/mcrypt.so"
You are ready to go!
Upgrade Mcrypt using Homebrew
$ brew reinstall -fs php71-mcrypt
I hope this one can help someone
I have tried to install mcrypt with php7.1 but I got a warning "pecl/mcrypt requires PHP (version >= 7.2.0, version <= 7.3.0, excluded versions: 7.3.0)"
so I changed to php version 7.2 and run
sudo pecl install mcrypt-1.0.1
after that, I switch to PHP 7.1 and it works
I'm using mac os v10.14 and apache environment