4

I am installing a fresh kubuntu system 18.04, which is using by default php7.2

A composer install for my current software project gibves me this error message:

The requested PHP extension ext-mcrypt * is missing from your system. Install or enable PHP's mcrypt extension.

Other than before there is no php-mcrypt available and other articles like this http://aryo.lecture.ub.ac.id/easy-install-php-mcrypt-extension-on-ubuntu-linux/ don't help since an analog php-mcrypt or php7-mcrypt does not exists.

How can I get a setup, which fulfills my requirement?

sudo apt-get install php7.2-ext-mcrypt

does not find an installation candidate.

Is there a difference between php 7.1 and 7.2?

not surprisingly this also does not do the trick:

$ sudo phpenmod mcrypt
WARNING: Module mcrypt ini file doesn't exist under /etc/php/7.2/mods-available
WARNING: Module mcrypt ini file doesn't exist under /etc/php/7.2/mods-available
Calamity Jane
  • 2,189
  • 5
  • 36
  • 68
  • 1
    mcrypt was abandoned and is no longer supported in PHP. You can't install mcrypt in a current version of PHP. You'll have to migrate your code to a newer enctyption library such as openssl or libsodium – GordonM May 16 '18 at 11:55
  • Do I understand this correctly. For openssl I have to compile a php version with openssl and libsodium is already part of php 7.2? https://secure.php.net/manual/en/openssl.installation.php – Calamity Jane May 16 '18 at 14:33
  • 1
    Theoretically openSSL support does have to be compiled in, but in practice it's very common for that to already be the case as it's a widely used library. As far as I'm aware libsodium is always available in PHP 7.2 – GordonM May 17 '18 at 08:12
  • You are right. Luckily it is already compiled in in the version I am using. libsodium had an annoying bug in version 1.0.16 "PHP Fatal error: sodium_init() in Unknown on line 0" so I am switching now to openssl. Also sodium isn't very well documented IMHO. – Calamity Jane May 17 '18 at 09:21

1 Answers1

0

So it looks like mcrypt is deprecated with php7.2

So I will either have to replace it in my software or follow e.g. this howto to circumvent it: https://serverpilot.io/community/articles/how-to-install-the-php-mcrypt-extension.html

Calamity Jane
  • 2,189
  • 5
  • 36
  • 68
  • 5
    DO NOT TRY TO CIRCUMVENT IT! mcrypt support was removed in PHP 7 for very good reasons, namely it's not been worked on in years and contains a whole raft of known unpatched vulnerabilities. If you manage to hack mcrypt support into your PHP installation you'll have basically installed a broken encryption library that will never be fixed. Look to migrate your code instead. – GordonM May 16 '18 at 11:57