composer install报错:Content-Length mismatch, received 179968 bytes out of the expected 4932506

时间:2024-03-28 15:29:05

composer install报错:Content-Length mismatch, received 179968 bytes out of the expected 4932506

执行composer install报错

composer install报错:Content-Length mismatch, received 179968 bytes out of the expected 4932506

解决方案

此时 查看一下当前项目的composer镜像

composer config -l

composer install报错:Content-Length mismatch, received 179968 bytes out of the expected 4932506

发现自己使用的镜像是中国镜像

https://packagist.phpcomposer.com

这个镜像是有问题的 所以需要更换镜像

这边需要注意的是 更换镜像不要进行全局更换的命令 而是要针对这个项目去更换镜像

所以 我们在这个项目的根目录下也就是composer.json的路径下

针对这个项目 进行更换镜像 使用阿里云镜像!

composer config repo.packagist composer https://mirrors.aliyun.com/composer/

composer install报错:Content-Length mismatch, received 179968 bytes out of the expected 4932506
之后在进行要安装的依赖 就发现 安装成功了!