为什么PHP Composer这么慢? [英] Why is PHP Composer so slow?
问题描述
为什么 PHP Composer 这么慢,所以我要做的就是用零依赖?这是我运行的命令:
Why is PHP Composer so slow when all I do is init a project with zero dependencies? Here are the commands I run:
composer init
<逐步创建composer.json,定义0个零依赖性>
<step through composer.json creation, define 0 zero dependencies>
composer install
等待3分钟(不要夸张)。
Wait 3 minutes (not an exaggeration).
所有作曲家所要做的就是拉入自动装带器并创建 / vendor
,那为什么要花这么长时间?为此,为什么在 composer init
上不执行该步骤?
All composer has to do is pull in an autoloader and create /vendor
, so why does it take so long? For that matter, why doesn't that step happen on composer init
?
是否可以使用配置选项
推荐答案
时用于拉入缓存的自动加载程序和供应商?另外,禁用 Xdebug 。即使运行像 composer --version
这样简单的命令,Xdebug也会使Composer花费几分钟的时间。
Also, disable Xdebug. Xdebug can cause Composer to take minutes even when running a command as simple as composer --version
.
这篇关于为什么PHP Composer这么慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!