Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant create new entry. PHPLDAPADMIN

I just installed LDAP and PHPLDAPADMIN.Its work fine but when I want Create new entry page just refresh and nothing happend.There are a few errors:

Unrecognized error number: 8192: Function create_function() is deprecated

Errors in phpldapadmin

Thank you.

like image 558
Jirka Vít Avatar asked Jun 05 '18 11:06

Jirka Vít


2 Answers

Try this code working fine.

/usr/share/phpldapadmin/lib/functions.php on line 54

change line 54 to

function my_autoload($className) {

Add this code on line 777

spl_autoload_register("my_autoload"); 

change line 1083 to

$CACHE[$sortby] = __create_function('$a, $b',$code);

add the code below on line 1091 from the

   function __create_function($arg, $body) {
        static $cache = array();
        static $maxCacheSize = 64;
        static $sorter;

        if ($sorter === NULL) {
            $sorter = function($a, $b) {
                if ($a->hits == $b->hits) {
                    return 0;
                }

                return ($a->hits < $b->hits) ? 1 : -1;
            };
        }

        $crc = crc32($arg . "\\x00" . $body);

        if (isset($cache[$crc])) {
            ++$cache[$crc][1];
            return $cache[$crc][0];
        }

        if (sizeof($cache) >= $maxCacheSize) {
            uasort($cache, $sorter);
            array_pop($cache);
        }

        $cache[$crc] = array($cb = eval('return 
    function('.$arg.'){'.$body.'};'), 0);
        return $cb;
    }

finally restart your apache server sudo service apache2 restart

like image 155
Senthil Avatar answered Oct 09 '22 20:10

Senthil


PhpLdapAdmin uses a few functions which are deprecated in PHP 7.2. Take a look at this fix: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890127

like image 32
Víctor Flamenco Avatar answered Oct 09 '22 20:10

Víctor Flamenco