我刚刚安装了 LDAP 和 PHPLDAPADMIN。它工作正常,但是当我想要创建新条目页面时,只需刷新并没有发生任何事情。有一些错误:
无法识别的错误号:8192:不推荐使用函数 create_function()
谢谢你。
我刚刚安装了 LDAP 和 PHPLDAPADMIN。它工作正常,但是当我想要创建新条目页面时,只需刷新并没有发生任何事情。有一些错误:
无法识别的错误号:8192:不推荐使用函数 create_function()
谢谢你。
试试这个代码工作正常。
/usr/share/phpldapadmin/lib/functions.php 在第 54 行
将第 54 行更改为
function my_autoload($className) {
在第 777 行添加此代码
spl_autoload_register("my_autoload");
将第 1083 行更改为
$CACHE[$sortby] = __create_function('$a, $b',$code);
在第 1091 行添加以下代码
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;
}
最后重启你的apache服务器sudo service apache2 restart
PhpLdapAdmin 使用了一些 PHP 7.2 中已弃用的函数。看看这个修复: https ://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890127