composer的一些报错及解决办法
下面由composer教程栏目给大家介绍composer的一些报错及解决办法,希望对需要的朋友有所帮助!
问题1
执行以下命令:
composer require sonata-project/doctrine-orm-admin-bundle "2.3.*"
报错:
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 32 bytes)
解决:
php -r "echo ini_get('memory_limit').PHP_EOL;" # 查看memory大小 COMPOSER_MEMORY_LIMIT=-1 composer require sonata-project/doctrine-orm-admin-bundle # 临时设置memory大小
参看官方说明(打开太慢了):
https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors
问题2
but these conflict with your requirements or minimum-stability.
解决:在composer.json中添加以下
"minimum-stability": "dev",
切换composer国内镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com
更多composer相关技术文章,请访问composer栏目:tool/composer/
以上就是composer的一些报错及解决办法的详细内容,更多请关注其它相关文章!