Why is PHP Composer so slow?(为什么 PHP Composer 这么慢?)
问题描述
为什么 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).
所有 composer 所要做的就是拉入一个自动加载器并创建 /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
?
是否有一个配置选项可用于在 init
时拉入缓存的自动加载器和供应商?
Is there a configuration option I can use to pull in a cached autloader and vendor upon 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 这么慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么 PHP Composer 这么慢?


基础教程推荐
- php中的foreach复选框POST 2021-01-01
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- php中的PDF导出 2022-01-01
- 将变量从树枝传递给 js 2022-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
- Web 服务器如何处理请求? 2021-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01