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
1
zgk 2016-01-31 08:55:12 +08:00 via Android
应该是主题循环文章或者分类目录访问数组的时候访问了一个不存在的 key 然后就报错了,可能是主题作者直接在线上环境调试没看到这个错误。一般来说访问一个数组之前最好用 isset 或者 empty 来判断一下。
|
2
GUMU 2016-01-31 10:05:33 +08:00
这是哪个主题?如果是公开的可以放出来~说不定能找到哪儿写错了
|
3
zuanfeng OP @GUMU
https://github.com/mikeyzm/White-M/releases 我问了作者说是我的伪静态不对,不过我怎么试也不行。 https://github.com/koyoter/simple-theme 我也试了同样的问题,囧。 http://www.imhan.com/archives/magike_editor_for_typecho_09/ 这个插件真心简洁我也想用也是同样的错误,主题不重要了,能否把这个插件弄一弄? |