我如何修复 Nextcloud PHP Fatal error: Class contains 1 abstract method and must therefore be declared abstract

最近我的 Nextcloud 16 实例(通过 PHP 7.2 FPM 在 Nginx 上运行)在尝试访问时返回 HTTP 状态 500(内部服务器错误)。

分析 Web 服务器日志显示此错误消息:

nextcloud_php_fatal.txt
FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class OC\Authentication\Token\PublicKeyToken contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (OC\Authentication\Token\IToken::setExpires) in /var/sites/nextcloud.mydomain.com/lib/private/Authentication/Token/PublicKeyToken.php on line 47" while reading response header from upstream, client: 2003:ea:b747:ee00:7491:f492:480:57a9, server: nextcloud.mydomain.com, request: "PROPFIND /remote.php/dav/files/admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "nextcloud.mydomain.com"

经过一些研究,我发现 - 至少在我的情况下 - 可以通过刷新 PHP opcache 来修复此问题:

reload_php_fpm.sh
sudo service php7.2-fpm reload

之后,nextcloud 开始正常工作。


Check out similar posts by category: Nextcloud, PHP