Last updated on November 25, 2022
Recently I tried to install YII2 but I got “The mcrypt PHP extension is not installed.” error.
In this post, I will show you how to fix this issue and show you how to install mcrypt.
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.
I am using suing ubuntu, below are the commands for installing mcrypt. Open your terminal and run the commands.
# install php module called php5-mcrypt
$ sudo apt-get install php5-mcrypt
# enable mcrypt module
$ sudo php5enmod mcrypt
# restart service
$sudo service apache2 restart
That’s it.