加入终身会员

您现在的位置:主页 > CMS学院 > 常见问题

织梦系统模板安装好后,进入后台出现 Fatal error: Call to undefined function make_hash()

来源:本站原创 发布时间:2024-08-09 17:03:33 热度:104℃

  这个错误一般是由于在安装或升级织梦系统过程中的疏漏,导致引用了未定义的函数或函数文件缺失。

一、进入织梦系统文件夹/include/common.func.php查看是否存在以下两个函数,如果没有,请将以下两个函数粘贴到文件中

function make_hash() {
$rand = dede_random_bytes(16);
$_SESSION['token'] = ($rand === FALSE)
? md5(uniqid(mt_rand(), TRUE))
: bin2hex($rand);
return $_SESSION['token'];
}

function dede_random_bytes($length) {
if (empty($length) OR ! ctype_digit((string) $length)) {
return FALSE;
}
if (function_exists('random_bytes')) {
try {
return random_bytes((int) $length);
}
catch (Exception $e) {
return FALSE;
}
}
if (defined('MCRYPT_DEV_URANDOM') && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE) {
return $output;
}
if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE) {
is_php('5.4') && stream_set_chunk_size($fp, $length);
$output = fread($fp, $length);
fclose($fp);
if ($output !== FALSE) {
return $output;
}
}
if (function_exists('openssl_random_pseudo_bytes')) {
return openssl_random_pseudo_bytes($length);
}
return FALSE;
}

二、如果以上方法失效,可以直接将报错文件中的make_hash()函数注释或删除

找到报错文件如下:

打开/dede/sys_info.php,找到210行左右

这里我们将make_hash()注释或者删除即可。

以上就是关于织梦系统模板安装好后,进入后台出现 Fatal error: Call to undefined function make_hash()的详细内容,更多请关注常见问题栏目其它相关文章!

转载请注明来源网址:https://www.51zmb.com/cmsxy/cmswt/2183.html