我必须在自己的nas服务器上为php web项目使用composer。Composer在我的nas上可用,我下载了最新版本,但如果我调用安装或更新,它需要很长时间,然后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"
}
}
}
这是我开始作曲的召唤:
php composer.phar update --prefer-dist -vvv --profile >./composer.log.txt
他跑了很长时间,几个小时后(!!)我用CTRL+C把它干掉了。并没有问题,若作曲家需要很长的时间,也许几个小时,但他至少应该完成他的作品。我得告诉你一些关于纳斯的事。它并不强大。1.2 GHz,128 MB RAM。所以这对运行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$doctrine-abstract-bundle.json写入缓存"7小时内没有进一步进展。但硬盘驱动器运行得很好。
我再次尝试了很长一段时间,然后composer从缓存中读取/root/.composer/cache/repo/https--packagist.org/provider symfony$doctrine-abstract-bundle.json。
你知道该怎么办吗?我很乐意听取每一条建议。非常感谢。
查看硬件详细信息后,情况很清楚:128 MB的RAM不够!
我见过Composer的报告,在更极端的情况下使用高达4 GB的数据,而且很容易经常使用高达1 GB的数据。您的NAS可能正忙于交换,如果有足够的时间,最终会完成,但这可能需要几天甚至几周的时间。
不要在功率不足的硬件上运行Composer。试着在能够提供充足RAM的机器上运行它。然后获取所有下载的文件,并将它们放在NAS上以运行应用程序。
此外,运行更新并使用"最低稳定性:dev"会使情况变得更糟。运行更新会迫使Composer下载大量关于它可能更新到的所有可能版本的包信息。使用开发稳定性运行会大大增加版本数量。
我认为Composer可能可以简单地运行install
(它需要更少的RAM,因为它只需要下载composer.lock
中提到的所有包),但128 MB可能太低了,无法成功。