# phpldapadmin: incompatibility with php7.1+

## msst

Since updating php to 7.1 it fails due to an incompatible change:

Function mcrypt_module_open() is deprecated

lib/functions.php (184)

 	Funktion	error (a:5:{i:0;s:74:"Unbekannte Fehlernummer: 8192: Function mcrypt_module_open() is deprecated)

this gets called from the login so the whole package is unusable with the newer php versions as all login attempts give a backtrace.

Do someone know an easy fix or a better replacement (as the package seems to be very weakly maintained also)?

----------

## msst

Workaround:

The coder of this function was actually nice and is trying to query and use mcrypt only if available. This however fails now as the function is still present, but apparently disabled in php7.1+

It can be commented out without bad side-effects however, as phpldapadmin will then use its own blowfish implementation. See for example:

```

/*

        if (function_exists('mcrypt_module_open') && ! empty($data)) {

                $td = mcrypt_module_open(MCRYPT_BLOWFISH,'',MCRYPT_MODE_ECB,'');

                $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),MCRYPT_DEV_URANDOM);

                mcrypt_generic_init($td,substr($secret,0,mcrypt_enc_get_key_size($td)),$iv);

                $encrypted_data = base64_encode(mcrypt_generic($td,$data));

                mcrypt_generic_deinit($td);

                return $encrypted_data;

        }

*/

        if (file_exists(LIBDIR.'blowfish.php'))

                require_once LIBDIR.'blowfish.php';

        else

```

The comment parantheses /* */ added by me. This needs to be done twice as the them query is done a few lines further down as well. With this code block commented out blowfish.php is used instead then (see the lines below, LIBDIR.'blowfish.php' exists in the standard phpldapadmin tarball).

----------

