How to install mcrypt on CentOS 7.6?

October 12, 2019 195 views
CentOS

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?

1 Answer

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:

extension=mcrypt.so

Let me know how it goes.

Have another answer? Share your knowledge.