我安装了一个包含composer的包,并且它安装了许多其他包作为依赖项.
现在我卸载了主程序包composer remove packageauthor/packagename,但是没有删除所有旧的依赖项.我希望composer能够清理并只保留根据它们composer.json和依赖项所需的包.
如何强制编写器清理并删除所有未使用的包?
Composer可以选择仅在开发时加载多个依赖项,因此这些工具不会安装在生产环境中(在实时服务器上).对于仅在开发中有意义的脚本(如测试,伪数据工具,调试器等),这(理论上)非常方便.
要做的就是require-dev使用dev中需要的工具添加一个额外的块:
"require-dev": {
    "codeception/codeception": "1.6.0.3"
}
然后(理论上)通过加载这些依赖
composer install --dev
Composer已经改变了2013年的行为,install并且update在require-dev默认情况下安装了依赖项(!),随意创建一个带有require-dev块的composer.json 并执行composer install重现.
最受欢迎的部署方式是推动作曲家.锁定(保存当前的作曲家设置),然后composer install在生产服务器上执行,这也将安装开发的东西.
在不安装-dev依赖项的情况下部署此方法的正确方法是什么?
注意:我正在尝试创建一个规范的Q/A,以澄清奇怪的Composer部署.随意编辑这个问题.
我正在尝试使用Composer安装Facebook PHP SDK.这就是我得到的
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
    Problem 1
        - Installation request for facebook/php-sdk dev-master -> satisfiable by facebook/php-sdk[dev-master].
        - facebook/php-sdk dev-master requires ext-curl * -> the requested PHP extension curl is missing from your system.
问题是,我启用了curl扩展(在php.ini中取消注释).当我跑步时phpinfo(),它表示它已启用.我只知道当我跑步时$ php -m,"卷曲"线丢失但我不知道该怎么办.
我在Win8上运行2.4,我在cmd.exe中运行composer.
这是我的composer.json,我想在Github上使用Nodge的lessphp项目分支
 "repositories": [{
    "type": "package",
    "package": {
        "version": "dev-master",
        "name": "nodge/lessphp",
        "source": {
            "url": "https://github.com/Nodge/lessphp.git",
            "type": "git",
            "reference": "master"
        },
        "autoload": {
            "classmap": ["lessc.inc.php"]
        }
    }
}],
"require": {
    "php": ">=5.3.3",
    "nodge/lessphp": "dev-master"
},
但是当我进行更新时,我有这个错误:
nodge/lessphp dev-master - >找不到匹配的包.
我不知道如何正确地要求它这个叉...
有什么建议 ?
composer update和之间有什么区别composer install?
尝试通过安装程序安装程序在Win7/64 + WampServer 2.2上安装Composer依赖关系管理工具,我收到以下消息:
缺少openssl扩展,这将降低Composer的安全性和稳定性.如果可能,您应该启用它或使用--with-openssl重新编译php
所以这就是我所做的......
php > php extensions > php_opensslphp > php.ini并搜索openssl以验证它没有被评论出来.它不是.我错过了什么?
请指教.
我想安装Zend Framework 2.所以我下载了骨架应用程序.如ZF2手册中所述,我们必须发出命令
php composer.phar install 
在骨架里面.
但是我收到了一个错误
您必须启用openssl扩展才能通过https下载文件
然后我在我的wamp中启用了ssl_module,我检查了php_ini文件,我可以看到以下行
延长= php_openssl.dll
我仍然得到同样的错误.有谁知道我错过了什么?
我只是无法解决这个问题.
我正在使用Linode 1G RAM基本计划.试图通过Composer安装一个包,它不会让我.我的内存限制在PHP.ini上设置为"-1"
我还能做些什么来安装它吗?
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing thujohn/rss (dev-master df80a7d)
    Downloading: 100%         
PHP Fatal error:  Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:975
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 975, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(975): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(853): Symfony\Component\Console\Application->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(818): Symfony\Component\Console\Application->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(752): Symfony\Component\Console\Application->getTerminalWidth()
#5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 975
Fatal error: …我正在使用PHP7在Ubuntu 16.04服务器上运行laravel 5.4.试图安装cviebrock/eloquent-sluggable包抛出一些错误:
pish@let:/home/sherk/ftp/www$ sudo composer require cviebrock/eloquent-sluggable
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^4.2 for cviebrock/eloquent-sluggable
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - phpunit/php-code-coverage 4.0.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - phpunit/php-code-coverage 4.0.7 requires ext-dom * -> the requested …当我运行时,composer update我收到此错误消息:
Loading composer repositories with package information
Updating dependencies (including require-dev)
    Failed to download psr/log from dist: The zip extension and unzip command are both missing, skipping.
The php.ini used by your command-line PHP is: /etc/php/7.0/cli/php.ini
    Now trying to download from source
我需要做什么来启用zip和unzip命令,以便作曲家可以下载依赖项?
composer-php ×10
php ×8
laravel ×2
curl ×1
deployment ×1
git-fork ×1
github ×1
laravel-4 ×1
laravel-5.4 ×1
openssl ×1
php-7 ×1
ssl ×1
wampserver ×1
windows ×1