2022年5月19日更新

终究还是要面对这个问题,原因是在测试AWS扩展时需要运行composer update,否则会提示缺少支持。
即便是我重装了MediaWiki还是解决不了,直到我尝试换资源库的源。
当我改成阿里云的国内云时,错误提示改变了:

  Problem 1
    - Root composer.json requires wikimedia/object-factory 2.2.0, found wikimedia/object-factory[dev-master, 1.0.0, v2.0.0, v2.1.0, v3.0.0, v3.0.1, v3.0.2] but it does not match the constraint.
  Problem 2
    - Root composer.json requires wikimedia/parsoid 0.12.2 -> satisfiable by wikimedia/parsoid[v0.12.2].
    - wikimedia/parsoid v0.12.2 requires wikimedia/object-factory ^2.1 -> found wikimedia/object-factory[v2.1.0] but it conflicts with your root composer.json require (2.2.0).

Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.

从六十多个问题变成了两个问题,有进步。修改composer.json文件,把版本号调整之后还是没用,不过倒是也给了一个思路,就是问题可能出在源上。
重新编辑composer.json文件,在底部加上

{
    "repositories": {
         "foo": {
             "type": "composer",
             "url": "https://mirrors.aliyun.com/composer/"
         },
         "packagist": {
            "type": "composer",
            "url": "https://packagist.org/"
        }
    }
}

再次composer update,提示:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires wikimedia/object-factory ^2.2.0, it is satisfiable by wikimedia/object-factory[v2.2.0, 2.x-dev] from composer repo (https://repo.packagist.org) but wikimedia/object-factory[dev-master, 1.0.0, v2.0.0, v2.1.0, v3.0.0, v3.0.1, v3.0.2] from composer repo (https://mirrors.aliyun.com/composer) has higher repository priority. The packages from the higher priority repository do not match your constraint and are therefore not installable. That repository is canonical so the lower priority repo's packages are not installable. See https://getcomposer.org/repoprio for details and assistance.
  Problem 2
    - Root composer.json requires wikimedia/parsoid ^0.12.2 -> satisfiable by wikimedia/parsoid[v0.12.2].
    - wikimedia/parsoid v0.12.2 requires wikimedia/object-factory ^2.1 -> found wikimedia/object-factory[v2.1.0] but it conflicts with your root composer.json require (^2.2.0).

Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.

好像两个源中的文件版本不一致,删掉阿里云那部分,再次执行命令,竟然成功了。看来问题处在composer全局设置上。

2022年5月15日原文

实在是忍受不了每次用页面表单保存时的小问题(见《MediaWiki页面表单保存的小问题》),所以打算升级一下看看有没有可能修复该bug。
进入安装目录,运行git pull,过程相当漫长,时不时会中断,经过半天左右的时间总算是pull成功了。
然后是运行composer update --no-dev,然后就返回了一大堆的东西。

> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires composer/semver 1.7.2, found composer/semver[1.7.2] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
  Problem 2
    - Root composer.json requires cssjanus/cssjanus 1.3.0, found cssjanus/cssjanus[v1.3.0] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
  Problem 3
    - Root composer.json requires PHP extension ext-calendar * but it is missing from your system. Install or enable PHP's calendar extension.
……
To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/php/etc/php.ini
    - /usr/local/php/etc/php.d/02-opcache.ini
    - /usr/local/php/etc/php.d/03-imagick.ini
    - /usr/local/php/etc/php.d/04-fileinfo.ini
    - /usr/local/php/etc/php.d/05-memcache.ini
    - /usr/local/php/etc/php.d/05-memcached.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-calendar` to temporarily ignore these required extensions.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

总共有六十多个问题,其中除了第三个是由于PHP的扩展没安装导致的,其余都是跟支持文件有关。PHP的扩展安装好之后,错误少了几项,php相关的提示也没有了,但是问题仍然存在。
此时进入网站,查看系统版本可以看出已经升级到最新版本了。那就尝试运行一下升级脚本php maintenance/update.php,提示缺少必要的支持,就是上面列出的其中几项。
php maintenance/update.php --skip-external-dependencies方式升级没有问题。
测试一下使用,发现可视化编辑器和页面表单都无法使用,看来必要的支持不是说跳过就跳过的。
以下是尝试的解决办法:
删除vendor文件夹,重新git clone,无效(可能是版本的问题)。
删除主目录下composer.lock文件后,重新composer install;删除vendor目录下composer.lock文件后,重新composer install,下载安装了一些文件,貌似有上面提到的。
再次composer update --no-dev问题依然存在,但是升级脚本php maintenance/update.php不再提示出错,编辑器和页面表单正常。
问题暂时解决,有机会再继续。

最后修改:2022 年 05 月 19 日
如果觉得我的文章对你有用,请随意赞赏