ldap - 无法创建新条目。PHPLDAP管理员
问题描述
我刚刚安装了 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
推荐阅读
- bash - 用于查询 .txt 的 Bash 脚本
- amazon-web-services - Amazon Forecast boto3 服务员
- json - 来自 ESP8266 的 Firestore REST API POST 请求
- javascript - 带有 SAP UI5 的 Javascript 渲染管理器:创建自定义控件
- cucumber - 如何在黄瓜特征文件中传递复杂对象
- wordpress - Wordress 管理员网址将 www 更改为管理员
- html - 尝试使用 reactjs 和语义 ui 创建英雄图像
- java - 如何从 Java 中获取可用磁盘空间 *IN A FOLDER*
- linux - setrlimit 是否限制内核空间中的内存分配?
- c++ - C++ unordered_map 默认分配器