System error ‘[security.WindMcryptCbc.encrypt] extension ‘mcrypt’ is not loaded.’.

I don’t like error, but I have to fix the error, I note down here to do reference.

I’m using CentOS 7, I think cause by upgraded from PHP 5 to PHP 7.

I’m using DirectAdmin.

What I found from internet

The mcrypt extension has been abandonware for nearly a decade now, and was also fairly complex to use. It has therefore been deprecated in favour of OpenSSL, where it will be removed from the core and into PECL in PHP 7.2.

http://php.net/manual/en/migration71.deprecated.php

Either use PHP 7.1 or install mcrypt as a PECL extension. There many guides in internet on how to install a PECL extension:

https://www.google.com/search?q=directadmin+php+pecl

https://help.poralix.com/articles/installing-a-pecl-extension-for-php-on-directadmin-server

https://help.poralix.com/articles/install-pecl-extension-for-php-directadmin-server

Solution that I use from Poralix

cd /usr/local/directadmin/scripts/custom
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh
./php-extension.sh install mcrypt
service nginx restart
service php-fpm73 restart

Tags:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.