Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/271.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php composer.phar速度非常慢,无法完成安装或更新_Php_Composer Php - Fatal编程技术网

Php composer.phar速度非常慢,无法完成安装或更新

Php composer.phar速度非常慢,无法完成安装或更新,php,composer-php,Php,Composer Php,我必须在自己的nas服务器上为php web项目使用composer。 Composer在我的nas上可用,我下载了最新版本,但如果我调用install或update,它需要很长时间,然后Composer就什么都不做了(没有进一步的进展,它会在“写入缓存”或“从缓存读取”上出现问题) 几个小时的饮食: CPU: 0 - 19% HDD: 70%! RAM: 70 - 80% 。。。但没有进展。这位作曲家似乎停顿了一下,什么也没做。您将很快看到composer输出日志文件 我想向您展示我的com

我必须在自己的nas服务器上为php web项目使用composer。 Composer在我的nas上可用,我下载了最新版本,但如果我调用install或update,它需要很长时间,然后Composer就什么都不做了(没有进一步的进展,它会在“写入缓存”或“从缓存读取”上出现问题)

几个小时的饮食:

CPU: 0 - 19%
HDD: 70%!
RAM: 70 - 80%
。。。但没有进展。这位作曲家似乎停顿了一下,什么也没做。您将很快看到composer输出日志文件

我想向您展示我的composer.json:

    {
        "name": "symfony/framework-standard-edition",
        "license": "MIT",
        "type": "project",
        "description": "The \"Symfony Standard Edition\" distribution",
        "autoload": {
            "psr-0": { "": "src/" }
        },
        "require": {
            "php": ">=5.3.3",
            "symfony/symfony": "~2.4",
            "doctrine/orm": "~2.2,>=2.2.3",
            "doctrine/doctrine-bundle": "~1.2",
            "twig/extensions": "~1.0",
            "symfony/assetic-bundle": "~2.3",
            "symfony/swiftmailer-bundle": "~2.3",
            "symfony/monolog-bundle": "~2.4",
            "sensio/distribution-bundle": "~2.3",
            "sensio/framework-extra-bundle": "~3.0",
            "sensio/generator-bundle": "~2.3",
            "incenteev/composer-parameter-handler": "~2.0",
            "doctrine/doctrine-fixtures-bundle": "dev-master",
            "doctrine/data-fixtures" : "dev-master",
            "raveren/kint": "@dev",
            "cg/kint-bundle": "dev-master"
        },
        "scripts": {
            "post-install-cmd": [
                "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
            ],
            "post-update-cmd": [
                "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
            ]
        },
        "config": {
            "bin-dir": "bin"
        },
        "minimum-stability": "dev",
        "extra": {
            "symfony-app-dir": "app",
            "symfony-web-dir": "web",
            "incenteev-parameters": {
                "file": "app/config/parameters.yml"
            },
            "branch-alias": {
                "dev-master": "2.4-dev"
            }
        }
    }
下面是我启动composer的命令:

php composer.phar update --prefer-dist -vvv --profile >./composer.log.txt
他跑了很长一段时间,几小时后(!!)我用CTRL+C将它杀死。 这并没有问题,若作曲家需要很长的时间,也许几个小时,但他至少应该完成他的作品。 我必须告诉你一些关于nas的事情。它不强大。1.2千兆赫,128兆内存。所以这可能是运行composer的一个大问题

xdebug已停用

以下是composer日志输出composer.log.txt:

[0.9MB/0.11s] Reading ./composer.json
[0.9MB/0.20s] Loading config file ./composer.json
[0.9MB/0.30s] Executing command (CWD): git describe --exact-match --tags
[1.0MB/0.68s] Executing command (CWD): git branch --no-color --no-abbrev -v
[1.6MB/1.41s] Loading composer repositories with package information
[1.7MB/1.50s] Downloading https://packagist.org/packages.json
[1.7MB/1.71s] Writing /root/.composer/cache/repo/https---packagist.org/packages.json into cache
[1.7MB/1.78s] Updating dependencies (including require-dev)
[1.7MB/1.83s] Reading /root/.composer/cache/repo/https---packagist.org/p-provider-active.json from cache
[4.1MB/2.14s] Reading /root/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
[9.2MB/2.78s] Downloading https://packagist.org/p/provider-latest$27f0883b66e23851d98d77f3f2d38b260f97886ecaef58ba5270dc855617f31d.json
[13.9MB/3.66s] Writing /root/.composer/cache/repo/https---packagist.org/p-provider-latest.json into cache
[12.6MB/3.95s] Downloading https://packagist.org/p/provider-stale$8f6a69f2604637ea5a49e850799189ce535eef932daa4cd3a975876dfde82ece.json
[16.6MB/4.78s] Writing /root/.composer/cache/repo/https---packagist.org/p-provider-stale.json into cache
[15.1MB/5.18s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$data-fixtures.json from cache
[15.1MB/5.24s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$doctrine-fixtures-bundle.json from cache
[15.2MB/5.38s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jdorn$sql-formatter.json from cache
[15.2MB/5.41s] Reading /root/.composer/cache/repo/https---packagist.org/provider-psr$log.json from cache
[15.2MB/5.43s] Reading /root/.composer/cache/repo/https---packagist.org/provider-twig$twig.json from cache
[15.4MB/5.55s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$lexer.json from cache
[15.5MB/5.56s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$annotations.json from cache
[15.5MB/5.59s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$collections.json from cache
[15.5MB/5.61s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$cache.json from cache
[15.6MB/5.64s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$inflector.json from cache
[15.6MB/5.66s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$common.json from cache
[15.9MB/5.86s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$dbal.json from cache
[16.4MB/6.42s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-bridge.json from cache
[23.3MB/13.20s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$framework-bundle.json from cache
[24.9MB/14.40s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$doctrine-bundle.json from cache
[25.1MB/14.65s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$config.json from cache
[25.5MB/15.39s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$http-kernel.json from cache
[27.9MB/16.32s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$filesystem.json from cache
[28.3MB/16.68s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$routing.json from cache
[29.0MB/17.45s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$stopwatch.json from cache
[29.3MB/17.73s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$translation.json from cache
[29.8MB/18.24s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$dependency-injection.json from cache
[30.4MB/18.83s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$event-dispatcher.json from cache
[31.0MB/19.70s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$templating.json from cache
[31.5MB/20.71s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$http-foundation.json from cache
[31.9MB/21.23s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-core.json from cache
[32.6MB/21.92s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-csrf.json from cache
[33.5MB/23.54s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$debug.json from cache
[33.2MB/26.25s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$doctrine-cache-bundle.json from cache
[33.3MB/26.36s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security.json from cache
[34.2MB/28.09s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$process.json from cache
[34.6MB/28.49s] Reading /root/.composer/cache/repo/https---packagist.org/provider-kriswallsmith$assetic.json from cache
[34.9MB/28.84s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$options-resolver.json from cache
[35.2MB/29.16s] Reading /root/.composer/cache/repo/https---packagist.org/provider-knplabs$gaufrette.json from cache
[35.4MB/29.46s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$finder.json from cache
[35.8MB/30.25s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$assetic-bundle.json from cache
[36.5MB/36.41s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$console.json from cache
[37.0MB/36.86s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$orm.json from cache
[37.7MB/37.56s] Reading /root/.composer/cache/repo/https---packagist.org/provider-doctrine$instantiator.json from cache
[37.7MB/37.63s] Reading /root/.composer/cache/repo/https---packagist.org/provider-twig$extensions.json from cache
[37.8MB/37.67s] Reading /root/.composer/cache/repo/https---packagist.org/provider-swiftmailer$swiftmailer.json from cache
[37.9MB/37.76s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$swiftmailer-bridge.json from cache
[38.4MB/38.22s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$swiftmailer-bundle.json from cache
[38.8MB/38.72s] Reading /root/.composer/cache/repo/https---packagist.org/provider-sensio$distribution-bundle.json from cache
[39.1MB/39.19s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$class-loader.json from cache
[39.6MB/39.66s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$form.json from cache
[40.5MB/40.43s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$validator.json from cache
[41.4MB/41.43s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$yaml.json from cache
[42.9MB/42.52s] Reading /root/.composer/cache/repo/https---packagist.org/provider-sensiolabs$security-checker.json from cache
[42.9MB/42.69s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$property-access.json from cache
[43.2MB/42.96s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$locale.json from cache
[43.7MB/43.77s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$intl.json from cache
[44.6MB/44.70s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$icu.json from cache
[44.2MB/45.34s] Reading /root/.composer/cache/repo/https---packagist.org/provider-sensio$generator-bundle.json from cache
[44.6MB/45.93s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-bundle.json from cache
[44.6MB/46.20s] Reading /root/.composer/cache/repo/https---packagist.org/provider-incenteev$composer-parameter-handler.json from cache
[44.6MB/46.39s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$symfony.json from cache
[44.7MB/46.55s] Reading /root/.composer/cache/repo/https---packagist.org/provider-monolog$monolog.json from cache
[44.9MB/47.06s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$monolog-bridge.json from cache
[45.5MB/47.61s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$monolog-bundle.json from cache
[45.9MB/48.94s] Reading /root/.composer/cache/repo/https---packagist.org/provider-sensio$framework-extra-bundle.json from cache
[46.2MB/49.30s] Reading /root/.composer/cache/repo/https---packagist.org/provider-raveren$kint.json from cache
[46.3MB/49.32s] Reading /root/.composer/cache/repo/https---packagist.org/provider-cg$kint-bundle.json from cache
[46.3MB/49.34s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$framework-standard-edition.json from cache
[49.3MB/50.39s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$security-extra-bundle.json from cache
[49.4MB/50.49s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$di-extra-bundle.json from cache
[49.6MB/50.67s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-bundle.json from cache
[50.3MB/51.34s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$metadata.json from cache
[50.4MB/51.39s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$aop-bundle.json from cache
[50.5MB/52.92s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$cg.json from cache
[50.5MB/53.17s] Reading /root/.composer/cache/repo/https---packagist.org/provider-jms$parser-lib.json from cache
[50.5MB/53.25s] Reading /root/.composer/cache/repo/https---packagist.org/provider-phpoption$phpoption.json from cache
[56.5MB/58.98s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$browser-kit.json from cache
[57.2MB/62.36s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$css-selector.json from cache
[57.6MB/63.24s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$dom-crawler.json from cache
[58.1MB/64.05s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$propel1-bridge.json from cache
[58.6MB/64.73s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$serializer.json from cache
[59.0MB/67.62s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$twig-bridge.json from cache
[60.1MB/68.66s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$twig-bundle.json from cache
[60.7MB/69.85s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$web-profiler-bundle.json from cache
[61.6MB/73.41s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$proxy-manager-bridge.json from cache
[61.9MB/74.49s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$expression-language.json from cache
[62.0MB/75.01s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-acl.json from cache
[62.3MB/87.77s] Reading /root/.composer/cache/repo/https---packagist.org/provider-symfony$security-http.json from cache
[86.6MB/299.81s] Downloading http://packagist.org/p/symfony/doctrine-abstract-bundle$557a1f9a31777860331e98ff2877ea8d8caf0d14519abf3d20cba65cf3ad4fc0.json
[87.1MB/300.38s] Writing /root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-abstract-bundle.json into cache
在“将/root/.composer/cache/repo/https---packagist.org/provider symfony$doctor-abstract-bundle.json写入缓存”7小时后,没有进一步的进展。但是硬盘工作得很好

我再次尝试了很长一段时间,然后composer在“读取/root/.composer/cache/repo/https---packagist.org/provider symfony$doctrine-abstract-bundle.json from cache”上结巴

你知道怎么解决这个问题吗?
我很乐意接受每一个建议。谢谢。

在查看您的硬件详细信息后,情况很清楚:128 MB的RAM是不够的

我看到过一些报告,称Composer在更极端的情况下使用了高达4GB的内存,而且很容易经常使用1GB。您的NAS可能正忙于交换,如果有足够的时间,最终将完成交换,但这可能需要几天甚至几周的时间

不要在动力不足的硬件上运行Composer。试着在一台能够提供足够内存的机器上运行它。然后抓取所有下载的文件并将它们放在NAS上以运行应用程序

此外,通过运行更新并使用“最小稳定性:dev”,您会使事情变得更糟。运行更新会强制Composer下载大量有关其可能要更新的所有可能版本的软件包信息。使用dev稳定性运行会显著增加版本数量


我认为Composer可能只需运行
安装
(它需要更少的RAM,因为它只需下载
Composer.lock
中提到的所有软件包),但128MB可能太低而无法成功。

Composer的web基础设施似乎遇到了问题,所以这可能是暂时的问题。所以你认为这与我的配置或NAS服务器无关?我的网络连接很好,我尝试了两天的更新。谢谢你的信息!我在我的工作机器上安装了linux,带有i5和8GB的ram。是否可以在那里运行composer并让composer将下载的文件直接放入我的nas(安装了samba驱动器)?我希望避免复制所有文件,并希望让程序将文件直接保存到NAS。想法:1)也许我可以在本地计算机上初始化composer项目时设置目标路径?composer创建项目[PACKAGE][DESTINATION PATH][--FLAGS]2)另一个想法:使用git(它在我的NAS上提供),让composer在我的工作机器上创建.lock文件。然后提交这个文件。在NAS上,签出此文件并运行composer安装。你会寻求哪种解决方案?你还有别的想法吗?我想发布一些新闻。我认为不可能将composer install命令中的文件直接存储在nas服务器上。但我找到了解决办法。你在动力机器上运行composer的技巧非常完美。我在本地执行了composer更新。然后我将composer.lock复制到我的nas服务器并在那里执行composer安装,它就像一个魔咒一样工作。对我来说没关系。非常感谢你。