使用 Composer 更新 Semantic Mediawiki 失败,原因不明。我该怎么做才能让它正常工作?

使用 Composer 更新 Semantic Mediawiki 失败,原因不明。我该怎么做才能让它正常工作?

我在这个领域还很新,但我设法使用外部提供商安装并运行了 Mediawiki (1.31.0) 和 Semantic MediaWiki (2.5.6)。现在我正尝试按照安装指南(即使用 composer)升级到 Semantic Mediawiki 3.0。该过程似乎有效,但在更新依赖项的过程中(?)一半停止了,最后显示“已终止”消息。我该如何防止此故障?

这是我的PuTTy屏幕上的全文:

[email protected]/www/betawiki$ php composer.phar update --no-dev -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/customers/4/1/9/xlane.nl/httpd.www/betawiki): git branch --no-color --no-abbrev -v
Executing command (/customers/4/1/9/xlane.nl/httpd.www/betawiki): git describe --exact-match --tags
Executing command (/customers/4/1/9/xlane.nl/httpd.www/betawiki): git log --pretty="%H" -n1 HEAD
Executing command (/customers/4/1/9/xlane.nl/httpd.www/betawiki): hg branch
Executing command (/customers/4/1/9/xlane.nl/httpd.www/betawiki): fossil branch list
Executing command (/customers/4/1/9/xlane.nl/httpd.www/betawiki): fossil tag list
Executing command (/customers/4/1/9/xlane.nl/httpd.www/betawiki): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /home/xlane.nl/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /customers/4/1/9/xlane.nl/httpd.www/betawiki/vendor/composer/installed.json
Loading plugin Wikimedia\Composer\MergePlugin
  [merge-plugin] Loading composer.local.json...
  [merge-plugin] Merging mediawiki/semantic-media-wiki
Running 1.8.3 (2019-01-30 08:31:33) with PHP 7.2.14 on Linux / 4.4.134+20180824.0648.fc9acc4c.xenial
  [merge-plugin] Already merged composer.local.json completely
> pre-update-cmd: ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Downloading https://repo.packagist.org/packages.json
Writing /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Updating dependencies
Reading /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Reading /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
Reading /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/p-provider-2017.json from cache
Reading /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/p-provider-2018.json from cache
Reading /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/p-provider-2018-04.json from cache
Reading /home/xlane.nl/.composer/cache/repo/https---repo.packagist.org/p-provider-2018-07.json from cache
Downloading http://repo.packagist.org/p/provider-2018-10%244480dd3a8a06f875d02875a3784b38258f3cd53a96e69f3c3a6c57cbf048a3e3.json
Killed

答案1

“Killed” 意味着有什么东西伸出援手并终止了你的进程 - 而且它不是像段错误这样的代码问题。

我敢打赌,发生的事情是 Composer 在你的系统上消耗了太多内存,而 Linux OOM(内存不足)终止程序出于必要终止了 Composer,以确保你的系统能够继续运行。

要确认这一点,您需要查看系统日志。您没有指定正在运行的 Linux 版本,但以下方法之一应该有效:

  • journalctl
  • dmesg
  • less /var/log/syslog
  • less /var/log/messages

在您运行 Composer 时对 OOM 的任何引用都证实了此诊断 - 您需要为您的机器提供更多的 RAM。

另一种验证方法是打开到您的机器的另一个连接,启动作曲家,并在运行时密切关注top或的输出。free

相关内容