When I installed Yii2, I got exception which terminated my installation.
Script yii\composer\Installer::postCreateProject handling the post-create-project-cmd event terminated with an exception
[Exception]
The mcrypt PHP extension is required by Yii2.
5993
What’s mcrypt?
MCrypt is a replacement for the old crypt() package and crypt(1) command, with extensions. It allows developers to use a wide range of encryption functions, without making drastic changes to their code. It allows users to encrypt files or data streams without having to be cryptographers.
Yii2 using mcrypt to improved its crypt functions, so it’s one important PHP extension, and you cannot skip it.
I checked http://us1.php.net/manual/en/mcrypt.installation.php, and most comments is about Debian-based Linux system, and you can run the following commands to quickly install mcrypt:
sudo apt-get install php5-mcrypt
sudo /etc/init.d/apache2 restart
But I am using MacBook, so it gave me some trouble to install that. finally, I found very good article how to install mcrypt on MacOS.
If your MacOS is even older, you can refer to
Follow the steps exactly in the articles, you should be able to install mcrypt on your MacBook properly. See screen shots attached.5994