Cant create new entry. PHPLDAPADMIN
Asked Answered
P

2

5

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.

Predatory answered 5/6, 2018 at 11:2 Comment(0)
C
22

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

Catling answered 15/5, 2019 at 10:26 Comment(3)
added it written out in a link below but here it is again: github.com/wheelsmanx/phpldapadmin_functionsNutrient
This fix is still working as of 27.12.2020, just check the link in the comment above and copy the functions.php into /usr/share/phpldapadmin/lib and don't forget to backup your old functions.php because you never know ;-)Incarnation
Worked in the repository installation of Ubuntu 18.04. Don't forget the ; guys.Ramonramona
K
2

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

Kletter answered 20/9, 2018 at 9:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.