How to install mcrypt on CentOS 7.6?

This php script I am using requires mcrypt but the mcrypt module is depreciated and no longer available.

I tried yum -y install epel-release and yum -y install php-mcrypt but this doesn’t work.

Are there any other ways to install mcrypt?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey, @umijs

I managed to get this installed on my droplet using the following commands:

sudo yum install epel-release
sudo yum install libmcrypt-devel

If you are running the default PHP installation you will want to run the following command as well.

sudo yum install php-mcrypt

Also you will need to find which is your main php.ini file and add or uncomment the following line:

Let me know how it goes.