Matomo升级

背景

不知道出于什么原因,我的Matomo不能从网页直接升级。所以只能手动到后台升级,过程中碰到了一些问题,记录下来备用。

过程

进入Matomo所在目录(含有Matomo文件夹的目录),然后执行下述命令。

wget https://builds.matomo.org/matomo.zip
unzip -o matomo.zip
rm matomo.zip
rm How\ to\ install\ Matomo.html

接着再次进入Matomo页面,按提示操作即可。

问题

完成升级操作后,网站变得无法访问。报错与WordPress的WP-Matomo插件相关,具体如下。

Matomo encountered an error: Uncaught Exception: Piwik and/or some plugins have been upgraded to a new version. --> Please run the update process first. See documentation: https://matomo.org/docs/update/ in /home/wwwroot/fivyex.com/matomo/plugins/CoreUpdater/CoreUpdater.php:81 Stack trace:
#0 [internal function]: Piwik\Plugins\CoreUpdater\CoreUpdater->dispatch()
#1 /home/wwwroot/fivyex.com/matomo/core/EventDispatcher.php(141): call_user_func_array(Array, Array)
#2 /home/wwwroot/fivyex.com/matomo/core/Piwik.php(775): Piwik\EventDispatcher->postEvent('Request.dispatc...', Array, false, Array)
#3 /home/wwwroot/fivyex.com/matomo/core/FrontController.php(374): Piwik\Piwik::postEvent('Request.dispatc...')
#4 /home/wwwroot/fivyex.com/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Php.php(40): Piwik\FrontController->init()
#5 /home/wwwroot/fivyex.com/wp-content/plugins/wp-piwik/classes/WP_Piwik/Request/Php.php(18): WP_Piwik\Request\Php->call('method=SitesMan...', '/', 'module=API&form...')
#6 /home/wwwroot/fivyex.com/wp-content/plugins/ (which lead to: Session must be started before any output has been sent to the browser; output started in /home/wwwroot/fivyex.com/wp-includes/functions.php/4552)

解决

问题貌似是WP-Matomo在启用时报的错,可能是Matomo文件更新以后插件和Matomo的API连接会出现问题。

所以我们需要先将WP-Matomo禁用,待Matomo更新完成后再启用。

  • 可以把服务器回滚到出问题以前先禁用插件。
  • 抑或是删除wp-content/plugins/文件夹中删除该插件对应文件夹,恢复正常后再安装回来重新配置。

发表评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据