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中根据W3C规范Unicode 2022-01-01
- 如何替换eregi() 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
