V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zuanfeng
V2EX  ›  问与答

求助, typecho 分类目录出错

  •  
  •   zuanfeng · 2016-01-29 14:02:13 +08:00 · 1724 次点击
    这是一个创建于 3221 天前的主题,其中的信息可能已经有所发展或是发生改变。

    http://www.zuanfeng.net/category/vps/ 这个分类打开是正常的
    http://www.zuanfeng.net/category/domain/ 这个就出错误了
    An error occurred.
    Sorry, the page you are looking for is currently unavailable.
    Please try again later.
    If you are the system administrator of this resource then you should check the error log for details.
    为什么不是一起出错,而是一个正常一个错误?这个错误有没有解决办法?
    我把主题模板切换回官方自带的主题模板就都正常,没有新的错误记录产生。换成我上传的就产生新的日志,但是分类目录又能打开一阵子,过一阵子又是出错。

    PHP message: PHP Notice: Undefined index: slug in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 667
    PHP message: PHP Notice: Undefined index: slug in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 670
    PHP message: PHP Notice: Undefined index: cid in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 639
    PHP message: PHP Notice: Undefined index: created in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 653
    PHP message: PHP Notice: Undefined index: type in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 664
    PHP message: PHP Notice: Undefined index: slug in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 667
    PHP message: PHP Notice: Undefined index: slug in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 670" while reading response header from upstream, client: 23.4.92.14, server: zuanfeng.net, request: "GET /category/vps/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.zuanfeng.net", referrer: "http://www.zuanfeng.net/category/domain/"
    2016/01/29 13:03:33 [error] 12176#0: *1 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: cid in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 639
    PHP message: PHP Notice: Undefined index: created in /usr/share/nginx/html/var/Widget/Abstract/Contents.php on line 653

    3 条回复    2016-02-01 21:23:25 +08:00
    zgk
        1
    zgk  
       2016-01-31 08:55:12 +08:00 via Android
    应该是主题循环文章或者分类目录访问数组的时候访问了一个不存在的 key 然后就报错了,可能是主题作者直接在线上环境调试没看到这个错误。一般来说访问一个数组之前最好用 isset 或者 empty 来判断一下。
    GUMU
        2
    GUMU  
       2016-01-31 10:05:33 +08:00
    这是哪个主题?如果是公开的可以放出来~说不定能找到哪儿写错了
    zuanfeng
        3
    zuanfeng  
    OP
       2016-02-01 21:23:25 +08:00
    @GUMU
    https://github.com/mikeyzm/White-M/releases 我问了作者说是我的伪静态不对,不过我怎么试也不行。
    https://github.com/koyoter/simple-theme 我也试了同样的问题,囧。
    http://www.imhan.com/archives/magike_editor_for_typecho_09/ 这个插件真心简洁我也想用也是同样的错误,主题不重要了,能否把这个插件弄一弄?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1558 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:13 · PVG 01:13 · LAX 09:13 · JFK 12:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.