本帖最后由 esncy 于 2009-11-11 23:35 编辑
问题网站:http://www.90home.comUCH1.5
环境:linux+nginx
一、问题描述:
UCH1.5突然发现不知从什么时候开始,未登陆前的首页,站长推荐,FEED.应用推荐,群组话题,热门日志等等栏目全变在空白了.
因为在电脑设置了自动登陆,出现时间不确定.
配置一直没变过,后台也一直没改过.
调试:
1,因为怀疑被人挂马,把旧的备份文件index.php替换.更新缓存.首页OK了.
再刷新,又空白,怀疑模板文件也有问题.
2,替换模板首页文件.更新缓存.又OK了.
再刷新问题重复,之后才发现原来是每次更新缓存就行.
以为是缓存机制出了问题,去后台把缓存关掉.问题依旧.
最后找到一个朋友,解决.错误暂时是解决了.
问题来了.
按步骤说.
二、问题解决过程:
因为清掉缓存后第一次正常显示,然后就不正常,怀疑与缓存文件有关。故,调试index.php程序,慢慢找到以下代码段:
源代码为:- $caches = data_get('index_cache', 1);
- $caches['dateline'] = intval($caches['dateline']);
- if($_SCONFIG['networkupdate'] && $_SGLOBAL['timestamp'] - $caches['dateline'] < $_SCONFIG['networkupdate']) {
- @$caches['datavalue'] = unserialize($caches['datavalue']);
- @extract($caches['datavalue']);
- } else {
复制代码 我修改后的代码为(即不通过缓存文件来生成首页,而是直接从数据库中读取资料):- $caches = data_get('index_cache', 1);
- $caches['dateline'] = intval($caches['dateline']);
- //if($_SCONFIG['networkupdate'] && $_SGLOBAL['timestamp'] - $caches['dateline'] < $_SCONFIG['networkupdate']) {
- if (0){
- @$caches['datavalue'] = unserialize($caches['datavalue']);
- @extract($caches['datavalue']);
- } else {
复制代码 结果首页恢复正常。
三、原因查找及根源怀疑:
我将下面代码:- $caches = data_get('index_cache', 1);
- $caches['dateline'] = intval($caches['dateline']);
复制代码 进行修改下(即输出caches变量的值):- $caches = data_get('index_cache', 1);
- $caches['dateline'] = intval($caches['dateline']);
- print_r($caches);
复制代码 得到caches的运行结果如最后所示:
结果原来是一个数组,我留意到其中的datavalue关键元素的值,有一个异常点:该值以s:10:"结尾,但我以自己写程序的经验,感觉这可能不是一个正常的结尾。我的意思是:这个数组元素的值实际上,应该是不止这么长的,后面可能还有内容。但实际上这里的数据,有可能不完整。
怀疑根源是:是否因为这个不完整,造成数据无法正常分析到变量中?所以造成一切为空白?
- Array
- (
- [var] => index_cache
- [datavalue] => a:9:{s:8:"bloglist";a:11:{i:0;a:4:{s:6:"blogid";s:4:"2645";s:7:"subject";s:18:"我想我一点也不重要";s:3:"uid";s:3:"548";s:8:"username";s:10:"木偶.[cry]";}i:1;a:4:{s:6:"blogid";s:4:"2608";s:7:"subject";s:12:"【90后】乱谈";s:3:"uid";s:4:"2315";s:8:"username";s:6:"萧沐白";}i:2;a:4:{s:6:"blogid";s:4:"2576";s:7:"subject";s:26:"两个傻子的爱情、会感动吗?";s:3:"uid";s:4:"4292";s:8:"username";s:6:"乖乖凌";}i:3;a:4:{s:6:"blogid";s:4:"2566";s:7:"subject";s:10:"烦躁的很。";s:3:"uid";s:4:"4587";s:8:"username";s:10:"我、叫大傻";}i:4;a:4:{s:6:"blogid";s:4:"2578";s:7:"subject";s:14:"祝我生日快乐,";s:3:"uid";s:4:"3475";s:8:"username";s:4:"小六";}i:5;a:4:{s:6:"blogid";s:4:"2660";s:7:"subject";s:32:"黑月公主之-月-测测你的SD娃娃名字";s:3:"uid";s:4:"4703";s:8:"username";s:8:"卡布奇诺";}i:6;a:4:{s:6:"blogid";s:4:"2579";s:7:"subject";s:15:"亲耐的老婆~耐你";s:3:"uid";s:4:"4547";s:8:"username";s:9:"853228482";}i:7;a:4:{s:6:"blogid";s:4:"2571";s:7:"subject";s:56:"无论你有没男朋友、女朋友、都要把它看完,写的真是那么回事";s:3:"uid";s:4:"4292";s:8:"username";s:6:"乖乖凌";}i:8;a:4:{s:6:"blogid";s:4:"2673";s:7:"subject";s:38:"关于、《嫁衣》的故事。进来看前,请思考";s:3:"uid";s:4:"4292";s:8:"username";s:6:"乖乖凌";}i:9;a:4:{s:6:"blogid";s:4:"2636";s:7:"subject";s:6:"感动啊";s:3:"uid";s:4:"4734";s:8:"username";s:12:"校园。守望者";}i:10;a:4:{s:6:"blogid";s:4:"2655";s:7:"subject";s:22:"你的生命是什么颜色的?";s:3:"uid";s:4:"4703";s:8:"username";s:8:"卡布奇诺";}}s:9:"albumlist";a:7:{i:0;a:7:{s:7:"albumid";s:4:"1653";s:9:"albumname";s:10:"内、是我。";s:6:"picnum";s:1:"7";s:3:"pic";s:53:"attachment/200911/11/432_1257930541O4x5.jpg.thumb.jpg";s:7:"picflag";s:1:"1";s:3:"uid";s:3:"432";s:8:"username";s:14:"Li、lazy。pig'";}i:1;a:7:{s:7:"albumid";s:4:"1652";s:9:"albumname";s:14:"ヾ左岸の烟づ逝";s:6:"picnum";s:2:"24";s:3:"pic";s:54:"attachment/200911/10/4946_1257873073pCwq.gif.thumb.jpg";s:7:"picflag";s:1:"1";s:3:"uid";s:4:"4946";s:8:"username";s:12:"空白式、回忆";}i:2;a:7:{s:7:"albumid";s:4:"1537";s:9:"albumname";s:3:"FZL";s:6:"picnum";s:2:"48";s:3:"pic";s:54:"attachment/200911/10/4292_1257841431EW7w.jpg.thumb.jpg";s:7:"picflag";s:1:"1";s:3:"uid";s:4:"4292";s:8:"username";s:6:"乖乖凌";}i:3;a:7:{s:7:"albumid";s:4:"1582";s:9:"albumname";s:10:"我的!!!";s:6:"picnum";s:2:"12";s:3:"pic";s:44:"attachment/200911/10/4292_125784444152H8.gif";s:7:"picflag";s:1:"1";s:3:"uid";s:4:"4292";s:8:"username";s:6:"乖乖凌";}i:4;a:7:{s:7:"albumid";s:4:"1651";s:9:"albumname";s:12:"丑b1╮冷亞兮";s:6:"picnum";s:2:"11";s:3:"pic";s:44:"attachment/200911/10/4933_1257841600lS9L.jpg";s:7:"picflag";s:1:"1";s:3:"uid";s:4:"4933";s:8:"username";s:12:"丑b1╮冷亞兮";}i:5;a:7:{s:7:"albumid";s:4:"1544";s:9:"albumname";s:10:"这!!有点";s:6:"picnum";s:2:"37";s:3:"pic";s:54:"attachment/200911/10/4292_12578413161FPK.jpg.thumb.jpg";s:7:"picflag";s:1:"1";s:3:"uid";s:4:"4292";s:8:"username";s:6:"乖乖凌";}i:6;a:7:{s:7:"albumid";s:4:"1497";s:9:"albumname";s:4:"23班";s:6:"picnum";s:2:"21";s:3:"pic";s:54:"attachment/200911/10/4292_1257841205D3mD.jpg.thumb.jpg";s:7:"picflag";s:1:"1";s:3:"uid";s:4:"4292";s:8:"username";s:6:"乖乖凌";}}s:8:"feedlist";a:10:{i:0;a:23:{s:6:"feedid";s:5:"12399";s:5:"appid";s:1:"4";s:4:"icon";s:8:"sitefeed";s:3:"uid";s:1:"0";s:8:"username";s:5:"admin";s:8:"dateline";s:10:"1260101040";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"fee91d05e3841416ec83a0f578cd0579";s:9:"hash_data";s:32:"4e85eafca47f109c981bf602411ddfec";s:14:"title_template";s:19:"90后。每周6集体语音";s:10:"title_data";s:6:"a:0:{}";s:13:"body_template";s:202:"<b><a href=http://www.90home.com/bbs/thread-2019-1-1.html target=_blank><font color=#0000ff size=3.5>每周六晚集体语聊,IS频道:529017(我爱90一起)</font><!--font color=#ff0000>[今晚等你]</font--></a></b>";s:9:"body_data";s:6:"a:0:{}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:1;a:23:{s:6:"feedid";s:6:"125021";s:5:"appid";s:1:"1";s:4:"icon";s:4:"post";s:3:"uid";s:4:"2315";s:8:"username";s:6:"萧沐白";s:8:"dateline";s:10:"1257951474";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"812e994d43f7b4b4518084f3d78e614d";s:9:"hash_data";s:32:"e6beb1a1a912db2ffc12786958cd4302";s:14:"title_template";s:49:"{actor} 在 {app} 回复了 {author} 的话题 {subject}";s:10:"title_data";s:169:"a:2:{s:7:"subject";s:74:"<a href="link.php?url=http://www.90home.com%2Fbbs%2Fviewthread.php%3Ftid%3D5605">申请勋章、</a>";s:6:"author";s:46:"<a href="space-432.html">Li、lazy。pig'</a>";}";s:13:"body_template";s:0:"";s:9:"body_data";s:20:"a:1:{s:0:"";s:0:"";}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:2;a:23:{s:6:"feedid";s:6:"125022";s:5:"appid";s:1:"1";s:4:"icon";s:4:"post";s:3:"uid";s:4:"2315";s:8:"username";s:6:"萧沐白";s:8:"dateline";s:10:"1257951299";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"812e994d43f7b4b4518084f3d78e614d";s:9:"hash_data";s:32:"4b0a7f5d40089b35511deeafe451ebd1";s:14:"title_template";s:49:"{actor} 在 {app} 回复了 {author} 的话题 {subject}";s:10:"title_data";s:164:"a:2:{s:7:"subject";s:74:"<a href="link.php?url=http://www.90home.com%2Fbbs%2Fviewthread.php%3Ftid%3D5594">新人报道拉</a>";s:6:"author";s:41:"<a href="space-4948.html">似水无痕</a>";}";s:13:"body_template";s:0:"";s:9:"body_data";s:20:"a:1:{s:0:"";s:0:"";}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:3;a:23:{s:6:"feedid";s:6:"125020";s:5:"appid";s:1:"4";s:4:"icon";s:4:"show";s:3:"uid";s:4:"4656";s:8:"username";s:4:"林弦";s:8:"dateline";s:10:"1257951093";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"11589cf32ed2027f54e0dfa3e182993e";s:9:"hash_data";s:32:"0394671852a236f9aa30e42a03261962";s:14:"title_template";s:123:"{actor} 增加竞价积分 {credit} 个,提升自己在<a href="network-space-view-show.html" target="_blank">竞价排行榜</a>中的名次";s:10:"title_data";s:27:"a:1:{s:6:"credit";s:1:"4";}";s:13:"body_template";s:0:"";s:9:"body_data";s:6:"a:0:{}";s:12:"body_general";s:14:"9流榜!Oh yEah!";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:4;a:23:{s:6:"feedid";s:6:"125019";s:5:"appid";s:1:"0";s:4:"icon";s:7:"1033526";s:3:"uid";s:4:"4734";s:8:"username";s:12:"校园。守望者";s:8:"dateline";s:10:"1257951063";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"593df970f4dbddc35bde04da5fb32b53";s:9:"hash_data";s:32:"203ee961c6ce09085ced3488ae7b3c17";s:14:"title_template";s:127:"{actor},<a href="link.php?url=http://www.90home.com%2Fuserapp.php%3Fid%3D1033526" target="_top">荣光医院</a> 的伟大院长!再一次成功的治疗了打嗝!";s:10:"title_data";s:6:"a:0:{}";s:13:"body_template";s:0:"";s:9:"body_data";s:6:"a:0:{}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:5;a:23:{s:6:"feedid";s:6:"125018";s:5:"appid";s:1:"4";s:4:"icon";s:5:"doing";s:3:"uid";s:4:"4656";s:8:"username";s:4:"林弦";s:8:"dateline";s:10:"1257951046";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"5d83f64a0adb604daf6523dcc69b8b3d";s:9:"hash_data";s:32:"4a2323fc7608e8632998d1e461efbd96";s:14:"title_template";s:18:"{actor}:{message}";s:10:"title_data";s:54:"a:1:{s:7:"message";s:26:"星期天,苏州乐园社会实践…";}";s:13:"body_template";s:0:"";s:9:"body_data";s:28:"a:1:{s:4:"doid";s:4:"3142";}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:6;a:23:{s:6:"feedid";s:6:"125017";s:5:"appid";s:1:"4";s:4:"icon";s:5:"share";s:3:"uid";s:4:"4656";s:8:"username";s:4:"林弦";s:8:"dateline";s:10:"1257950997";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"a174eb5dd4cc32c0d3c75a9e9009ac23";s:9:"hash_data";s:32:"9b94b48614c1697a1f741fdd6f1f493c";s:14:"title_template";s:22:"{actor} 分享了一篇日志";s:10:"title_data";s:6:"a:0:{}";s:13:"body_template";s:43:"<b>{subject}</b><br>{username}<br>{message}";s:9:"body_data";s:358:"a:4:{s:7:"subject";s:77:"<a href="space-4656-do-blog-id-2762.html">《繁华背后心灵该何处去栖息》</a>";s:8:"username";s:37:"<a href="space-4656.html">林弦</a>";s:7:"message";s:150:"都市里的繁华喧嚣建立在以速度为前提之下,人们因此过着快节奏的生活,城市的经济得到了飞速的发展,而繁忙的工作却使人身心俱疲。 勤奋的工作使城市变得繁荣";s:3:"sid";s:3:"808";}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:34:"space.php?uid=4656&do=blog&id=2762";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:7;a:23:{s:6:"feedid";s:6:"125016";s:5:"appid";s:1:"4";s:4:"icon";s:4:"blog";s:3:"uid";s:4:"4656";s:8:"username";s:4:"林弦";s:8:"dateline";s:10:"1257950978";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"9b14457988d2c988e3c3fbfcf2cd813d";s:9:"hash_data";s:32:"42960179f14fe9ad8899dfb80b3ef3fd";s:14:"title_template";s:20:"{actor} 发表了新日志";s:10:"title_data";s:6:"a:0:{}";s:13:"body_template";s:29:"<b>{subject}</b><br>{summary}";s:9:"body_data";s:278:"a:2:{s:7:"subject";s:77:"<a href="space-4656-do-blog-id-2762.html">《繁华背后心灵该何处去栖息》</a>";s:7:"summary";s:150:"都市里的繁华喧嚣建立在以速度为前提之下,人们因此过着快节奏的生活,城市的经济得到了飞速的发展,而繁忙的工作却使人身心俱疲。 勤奋的工作使城市变得繁荣";}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:8;a:23:{s:6:"feedid";s:6:"123264";s:5:"appid";s:1:"0";s:4:"icon";s:7:"1035333";s:3:"uid";s:4:"4734";s:8:"username";s:12:"校园。守望者";s:8:"dateline";s:10:"1257950926";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"55c96a2b46e0a67ade61d1a7a00091de";s:9:"hash_data";s:32:"9f4a1329f1c0b0d324568590184fb68c";s:14:"title_template";s:149:"《<a href="userapp.php?id=1035333&my_suffix=L2luZGV4LnBocA%3D%3D" target="_top">开心动物园</a>》园长 {actor} 又新购置了一批稀奇动物,快来看看吧!";s:10:"title_data";s:6:"a:0:{}";s:13:"body_template";s:123:"Ta 说:《<a href="userapp.php?id=1035333&my_suffix=L2luZGV4LnBocA%3D%3D" target="_top">开心动物园</a>》的动物太可爱了!";s:9:"body_data";s:6:"a:0:{}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}i:9;a:23:{s:6:"feedid";s:6:"112623";s:5:"appid";s:1:"0";s:4:"icon";s:7:"1039554";s:3:"uid";s:4:"4341";s:8:"username";s:6:"末日、";s:8:"dateline";s:10:"1257950805";s:6:"friend";s:1:"0";s:13:"hash_template";s:32:"3cc0ff83da941853ebc13e0585ca04cf";s:9:"hash_data";s:32:"a308e46c519da91e5d2878cf34ea0dcb";s:14:"title_template";s:57:"{actor}的房间好漂亮、好气派啊,想来挑战一下自己的审美吗?";s:10:"title_data";s:6:"a:0:{}";s:13:"body_template";s:104:"<a href="userapp.php?id=1039554&my_suffix=Lw%3D%3D" target="_top">胡来旅馆,拥有自己梦想的房间!</a>";s:9:"body_data";s:6:"a:0:{}";s:12:"body_general";s:0:"";s:7:"image_1";s:0:"";s:12:"image_1_link";s:0:"";s:7:"image_2";s:0:"";s:12:"image_2_link";s:0:"";s:7:"image_3";s:0:"";s:12:"image_3_link";s:0:"";s:7:"image_4";s:0:"";s:12:"image_4_link";s:0:"";s:10:"target_ids";s:0:"";}}s:8:"mtaglist";a:3:{i:0;a:4:{s:5:"tagid";s:2:"55";s:7:"tagname";s:10:"90后。家族";s:9:"membernum";s:3:"370";s:3:"pic";s:64:"http://www.90home.com/attachment/200907/3/271_1246592315Hr7l.gif";}i:1;a:4:{s:5:"tagid";s:2:"87";s:7:"tagname";s:14:"90后帅哥美女群";s:9:"membernum";s:3:"227";s:3:"pic";s:16:"image/nologo.jpg";}i:2;a:4:{s:5:"tagid";s:2:"81";s:7:"tagname";s:12:"真诚一起幸福";s:9:"membernum";s:3:"166";s:3:"pic";s:16:"image/nologo.jpg";}}s:10:"threadlist";a:3:{i:55;a:3:{i:0;a:4:{s:3:"tid";s:3:"411";s:7:"subject";s:10:"找个友!!";s:3:"uid";s:4:"4742";s:8:"username";s:10:"
- [dateline] => 1257951839
- )
复制代码 |