马春杰杰 Exit Reader Mode

Typecho无法登陆后台,提示502 Bad Gateway

今天Typecho突然无法登陆后台了,其他一切正常,包括评论、浏览。登陆后台会提示:

502 Bad Gateway

打开log,可以看到一些报错:

 thrown in /www/wwwroot/www.xxxxxx.cn/var/Widget/Abstract/Contents.php on line 773" while reading response header from upstream, client: 222.135.25.175, server: www.xxxxxx.cn, request: "GET /htdocs.rar HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi-74.sock:", host: "www.xxxxxx.cn"
2024/01/25 20:13:55 [error] 4906#0: *53228 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function format() on null in /www/wwwroot/www.xxxxxx.cn/var/Widget/Abstract/Contents.php:773
Stack trace:
#0 /www/wwwroot/www.xxxxxx.cn/usr/themes/initial/header.php(17): Widget_Abstract_Contents->date()
#1 /www/wwwroot/www.xxxxxx.cn/var/Widget/Archive.php(1937): require('/www/wwwroot/ww...')
#2 /www/wwwroot/www.xxxxxx.cn/usr/themes/initial/404.php(2): Widget_Archive->need()
#3 /www/wwwroot/www.xxxxxx.cn/var/Widget/Archive.php(2022): require_once('/www/wwwroot/ww...')
#4 /www/wwwroot/www.xxxxxx.cn/var/Widget/ExceptionHandle.php(27): Widget_Archive->render()
#5 /www/wwwroot/www.xxxxxx.cn/var/Typecho/Common.php(240): Widget_ExceptionHandle->__construct()
#6 [internal function]: Typecho_Common::exceptionHandle()
#7 {main}

这主要是插件的问题,某个插件出问题了,当然,不同人可能出问题的插件不同,最好的方法是关闭所有的插件,然后重新启用就好了。

此时无法登陆后台,需要打开数据库进行操作:

打开typecho_options这个表,找到plugins这个字段,正常里面是有一堆的插件信息,我们把它改成:

a:0:{}

重新打开网站即可~