最新解決Discuz!X3.4以下版本前台打開卡慢、後台登陸卡死或504錯誤等問題
隻針對Discuz!X3.4以下的版本前台打開卡慢、後台登陸卡死或504錯誤的問題。
形成原因:discuz的補丁升級和版本檢查驗證已經關閉。而x3.4以下仍然在驗證和檢查導致鏈接超時,引起後台打不開。解決辦法有兩個。
解決方法一,升級到x3.4,x3.4版本已經移除了相關代碼。
解決方法二,修改代碼:
後台修改,文件source/admincp/admincp_main.php,刪除以下代碼大概37-60
if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && ($_G['setting']['showpatchnotice'] == 1 || !isset($_G['cookie']['checkpatch']))) {
$discuz_patch = new discuz_patch();
if($_G['setting']['showpatchnotice'] == 1) {
$notice = $discuz_patch->fetch_patch_notice();
if($notice['data']) {
$shownotice = '
}
}
if(!isset($_G['cookie']['checkpatch'])) {
$discuz_patch->check_patch();
}
}
if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && !$shownotice && $_G['setting']['upgrade']) {
$shownotice = '';
}
if($_G['uid'] && $_G['member']['allowadmincp'] == 1 && !isset($_G['cookie']['checkupgrade'])) {
$discuz_upgrade = new discuz_upgrade();
if($discuz_upgrade->check_upgrade()) {
if(empty($shownotice)) {
$shownotice = '';
}
}
dsetcookie('checkupgrade', 1, 7200);
}
前台修改,打開文件source\module\misc\misc_patch.php 將內容替換。
<?php
/**
- Discuz!2001-2099 https://yq.aliyun.com/articles/Comsenz Inc.
- This is NOT a freeware, use is subject to license terms *
- $Id: misc_patch.php 33690 2013-08-02 09:07:22Z nemohou $ */
if(!defined('IN_DIShttps://yq.aliyun.com/articles/CUZ')) {
exit('Access Denied');
}
if($_GET['action'] == 'checkpatch') {
header('https://yq.aliyun.com/articles/Content-Type: text/javascript');
exit;
} elseif($_GET['action'] == 'patchnotice') {
include template('common/header_ajax');
include template('common/footer_ajax');
exit;
} elseif($_GET['action'] == 'pluginnotice') {
include template('common/header_ajax');
include template('common/footer_ajax');
exit;
} elseif($_GET['action'] == 'ipnotice') {
require_once libfile('function/misc');
include template('common/header_ajax');
if($_G['cookie']['lip'] && $_G['cookie']['lip'] != ',' && $_G['uid'] && $_G['setting']['disableipnotice'] != 1) {
$status = https://yq.aliyun.com/articles/C::t('common_member_status')->fetch($_G['uid']);
$lip = explode(',', $_G['cookie']['lip']);
$lastiphttps://yq.aliyun.com/articles/Convert = convertip($lip[0]);
$lastipDate = dgmdate($lip[1]);
$nowiphttps://yq.aliyun.com/articles/Convert = convertip($status['lastip']);
$lastiphttps://yq.aliyun.com/articles/Convert = process_ipnotice($lastiphttps://yq.aliyun.com/articles/Convert);
$nowiphttps://yq.aliyun.com/articles/Convert = process_ipnotice($nowiphttps://yq.aliyun.com/articles/Convert);
if($lastiphttps://yq.aliyun.com/articles/Convert != $nowiphttps://yq.aliyun.com/articles/Convert && stripos($lastiphttps://yq.aliyun.com/articles/Convert, $nowiphttps://yq.aliyun.com/articles/Convert) == false && stripos($nowiphttps://yq.aliyun.com/articles/Convert, $lastiphttps://yq.aliyun.com/articles/Convert) == false) {
$lang = lang('forum/misc');
include template('common/ipnotice');
}
}
include template('common/footer_ajax');
exit;
}
?>
修改方法就這些,大家可以測試一下。
更多文章請閱讀
最後更新:2017-08-13 22:26:14