How to install and enable mcrypt

To install mcrypt in Ubuntu/Debian, run the following command:

sudo apt-get install php-mcrypt

In CentOS like this:

sudo yum install php-mcrypt

After that, the mcrypt.ini file will appear in the PHP directory with the mcrypt.so extension, in my case it appeared /etc/php/7.0/mods-available/mcrypt.ini.

You can activate/deactivate the module like this:

sudo phpenmod mcrypt
sudo phpdismod mcrypt

Restart Apache2 to apply the changes:

sudo service apache2 restart

Let’s see if mcrypt is activated:

php -i | grep -i mcrypt
Подписаться на IT Blog (RU) по Email
Subscribe to IT Blog (EN) by Email

Did my article help you? How about buying me a cup of coffee as an encouragement? Buy me a coffe.

Leave a Reply