MCrypt extension required to run Craft CMS

Posted August 2, 2020 1.2k views

I’m getting the following error on

Can’t run Craft CMS :(

Your server doesn’t meet the following requirements to run Craft CMS:

    The Mcrypt extension is required.

Please talk to your host/IT department about upgrading your server.

I was on PHP 7.3, have upgraded to PHP 7.4, but still getting the same error.

How do I fix this?

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.

Submit an Answer
1 answer

Hi there @drr1000,

You would need to manually install MCrypt using pecl. To install pecl you need to install the PHP Extension and Application Repository or PEAR for short:

  • sudo apt install php-pear

You might also have to install the PHP Dev tools:

  • sudo apt install php-dev

Then we would want to go ahead and install this package here. To do that, just run:

  • sudo pecl install mcrypt-1.0.3

Finally, make sure that you enable the new PHP extension by adding the following line to your php.ini:

If you are running PHP FPM make sure to restart it after the change to your php.ini file.

Hope that this helps.