composer安装与更新常见问题及解决方案
composer安装与更新常见问题及解决方案问题一:报错:Your requirements could not be resolved to an installable set of packages.原因:不匹配composer.json要求的版本。解决方案:使用命令 composer install --ignore-platform-reqs composer update --ignore-platform-reqs 设置忽略版本匹配然后再进行安装或更新你所需要的composer包问题二:报错:Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes).原因:php内存耗尽报错解决方案:修改php.ini (改配置)memory_limit = -1 重启PHP和nginx或者apache。问题三:composer更新缓慢原因:用的国外镜像解决方案:切换到国内镜像composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 注意:-g是全局,可以去掉-g就是当前项目
执行 composer update 命令的时候报 Your requirements could not be resolved to an installable set of packages. 错误
Your requirements could not be resolved to an installable set of packages.以上原因:不匹配composer.json要求的版本。 解决方案:composer可以设置忽略版本匹配,composer install --ignore-platform-reqs composer update --ignore-platform-reqs再次执行composer命令可以正常安装包了。