本机:composer 2.0,
当升级TP5.1 或插件时,是由于composer 1.0升级到composer 2.0后,TP5.1的插件不适合造成的,
The "topthink/think-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.1.0"). You may need to run composer update with the "--no-plugins" option.
https://mirrors.aliyun.com/composer could not be fully loaded (curl error 61 while downloading https://mirrors.aliyun.com/composer/p2/mpdf/mpdf~dev.json: Error while processing content unencoding: Unknown failure within decompression software.), package information was loaded from the local cache and may be out of date
[Composer\Downloader\TransportException]
curl error 61 while downloading https://mirrors.aliyun.com/composer/p2/mpdf/mpdf~dev.json: Error while processing content unencoding: Unknown failure within decompression software.
require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...
解决办法:
按提示:运行命令
//第一种:我是直接升级
composer update --no-plugins
//第二种:(没有测试)
composer --no-plugins
最终看自己
OK了,已经升级完成
再安装插件
composer require mpdf/mpdf 6.1.0
也不会再碰到之前的问题。
重要事件要说三次:记得备份 记得备份 记得备份
出错还能还原
如果用PHP版本composer升级出错,可以切对应PHP的版本再升级一次,就会还原的
我就是用php7.2版本来升级,但是服务器PHP版本是5.6,升级后用不了,后来再切换PHP5.6的composer再升级一次,就OK