参考网址
https://blog.csdn.net/hongyuancao/article/details/83412186
这个已经很详细了。具体我就不截图我本地的代码了。
如果composer报错,请依次执行composer命令:
清除
composer clearcache
更新
composer update
报错
https://mirrors.aliyun.com/composer could not be fully loaded (curl error 61 while downloading https://mirrors.aliyun.com/composer/p2/endroid/qr-code.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
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
[Composer\Downloader\TransportException]
curl error 61 while downloading https://mirrors.aliyun.com/composer/p2/endroid/qr-code
.json: Error while processing content unencoding: Unknown failure within decompression
software.
E:\code\php\work\boxingongying\bxcomon>composer config -g repo.packagist composer https://packagist.phpcomposer.com
E:\code\php\work\boxingongying\bxcomon>composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
E:\code\php\work\boxingongying\bxcomon>composer config secure-http false
E:\code\php\work\boxingongying\bxcomon>composer config -l -g
E:\code\php\work\boxingongying\bxcomon>composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
E:\code\php\work\boxingongying\bxcomon>composer config -g --unset repos.packagist
E:\code\php\work\boxingongying\bxcomon>composer require endroid/qr-code
成功