我必须在我自己的nas服务器上使用composer来创建一个php web项目。 Composer可以在我的鼻子上找到,我下载了最新的版本,但是如果我调用安装或更新,它需要很长时间,然后编写器不再做任何事情(没有加速进展,它停留在“写入缓存”或“从中读取”高速缓存“)。
吃几个小时:
CPU: 0 - 19%
HDD: 70%!
RAM: 70 - 80%
......但没有进展。作曲家看起来像是停顿了一下,什么都不做。您很快就会看到作曲家输出日志文件。
我想告诉你我的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。那么这对于运行作曲家来说可能是个大问题?
xdebug已停用。
这是作曲家日志输出,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小时没有进一步的进展。但硬盘驱动器运行了很多。
我再次尝试了很长时间,然后作曲家坚持“从缓存中阅读/root/.composer/cache/repo/https---packagist.org/provider-symfony$doctrine-abstract-bundle.json”
你知道该怎么做才能解决这个问题吗? 我会很高兴每一个建议。谢谢。
答案 0 :(得分:3)
在查看硬件详细信息后,情况很明显:128 MB的RAM还不够!
我已经看到Composer的报告在更极端的情况下使用多达4 GB,并且经常容易高达1 GB。你的NAS可能正在忙着交换,并且最终会在足够的时间内完成,但这可能需要几天甚至几周。
不要在功能不足的硬件上运行Composer。尝试在能够提供足够RAM的机器上运行它。然后获取下载的所有文件并将它们放在NAS上以运行应用程序。
此外,通过运行更新和“minimum-stability:dev”可以使事情变得更糟。运行更新会强制Composer下载有关可能要更新的所有可能版本的大量软件包信息。使用dev稳定性运行会大大增加版本的数量。
我认为Composer MIGHT能够简单地运行install
(它需要更少的RAM,因为它只需要下载composer.lock
中提到的所有包),但128 MB也可能是这样的低成功。