温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

解决织梦dedecms出现系统基本参数空白的方法

发布时间:2020-08-11 11:38:46 来源:亿速云 阅读:130 作者:小新 栏目:建站服务器

这篇文章主要介绍解决织梦dedecms出现系统基本参数空白的方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

织梦dedecms出现系统基本参数空白怎么办?

织梦dedecms出现系统基本参数空白或显示Call to undefined function make_hash()

推荐学习:织梦cms

最新的织梦版本(2018-01-09)修改了include文件夹中的common.func.php,增加了两个函数。

下载的模板文件夹中如果提供了common.func.php文件,很有可能没有这两个函数,于是会造成错误。

需要将这两个函数的代码粘贴到/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;
}

将以上代码粘贴到

/**

*  载入小助手,系统默认载入小助手

这段代码的上方即可。

以上是解决织梦dedecms出现系统基本参数空白的方法的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI