<tfoot id='R29sG'></tfoot>

  • <small id='R29sG'></small><noframes id='R29sG'>

      <i id='R29sG'><tr id='R29sG'><dt id='R29sG'><q id='R29sG'><span id='R29sG'><b id='R29sG'><form id='R29sG'><ins id='R29sG'></ins><ul id='R29sG'></ul><sub id='R29sG'></sub></form><legend id='R29sG'></legend><bdo id='R29sG'><pre id='R29sG'><center id='R29sG'></center></pre></bdo></b><th id='R29sG'></th></span></q></dt></tr></i><div id='R29sG'><tfoot id='R29sG'></tfoot><dl id='R29sG'><fieldset id='R29sG'></fieldset></dl></div>
        <bdo id='R29sG'></bdo><ul id='R29sG'></ul>

        <legend id='R29sG'><style id='R29sG'><dir id='R29sG'><q id='R29sG'></q></dir></style></legend>
      1. 作曲家在每个项目上都内存不足,Mac OS X

        时间:2023-10-31

          <bdo id='5ojvq'></bdo><ul id='5ojvq'></ul>
        • <i id='5ojvq'><tr id='5ojvq'><dt id='5ojvq'><q id='5ojvq'><span id='5ojvq'><b id='5ojvq'><form id='5ojvq'><ins id='5ojvq'></ins><ul id='5ojvq'></ul><sub id='5ojvq'></sub></form><legend id='5ojvq'></legend><bdo id='5ojvq'><pre id='5ojvq'><center id='5ojvq'></center></pre></bdo></b><th id='5ojvq'></th></span></q></dt></tr></i><div id='5ojvq'><tfoot id='5ojvq'></tfoot><dl id='5ojvq'><fieldset id='5ojvq'></fieldset></dl></div>

          • <legend id='5ojvq'><style id='5ojvq'><dir id='5ojvq'><q id='5ojvq'></q></dir></style></legend>
              <tbody id='5ojvq'></tbody>
            <tfoot id='5ojvq'></tfoot>

                <small id='5ojvq'></small><noframes id='5ojvq'>

                • 本文介绍了作曲家在每个项目上都内存不足,Mac OS X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我昨天尝试使用 Composer 在我的 Laravel 4 项目之一上安装 aws/aws-sdk-php,我不记得确切的事件链,但它没有成功安装.从那以后,我一直收到 Composer 内存不足的错误 - 致命错误:在 phar:///usr/local/bin/composer/中允许的内存大小为 536870912 字节已用尽(尝试分配 32 字节)src/Composer/DependencyResolver/RuleWatchGraph.php 第 52 行.

                  I attempted to install aws/aws-sdk-php yesterday on one of my Laravel 4 projects using Composer, I cannot remember exactly the chain of events but it did not install successfully. Ever since, I have been receiving errors that Composer has run out of memory - Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52.

                  我将 php.ini memory_limit 增加到 -1,这仍然发生在我的开发和生产环境中(生产环境是 Cent OS 6).如果我在运行 composer_update 时通过 CLI 增加 memory_limit 则安装成功完成,但这需要很长时间.

                  I increased the php.ini memory_limit to -1 and this still occurs, both in my development and production environments (production is Cent OS 6). Installation completes successfully if I increase the memory_limit via the CLI when I run composer_update but it takes an eternity.

                  是否需要清除某种缓存以防止 Composer 内存不足?我感觉每次运行 composer update 时它仍在尝试安装 AWS 开发工具包.

                  Is there some sort of cache that I need to clear to prevent Composer for running out of memory? I have a feeling that it is still trying to install the AWS SDK every time I run composer update.

                  作曲家文件

                  {
                      "name": "laravel/laravel",
                      "description": "The Laravel Framework.",
                      "keywords": ["framework", "laravel"],
                      "license": "MIT",
                      "require": {
                          "laravel/framework": "4.0.*",
                          "rtablada/package-installer": "dev-master",
                          "mogreet/mogreet-php": "dev-master",
                          "twilio/laratwilio": "dev-master",
                          "balloon/elephant.io": "dev-master",
                          "facebook/php-sdk": "dev-master",
                          "way/generators": "dev-master",
                          "codesleeve/asset-pipeline": "dev-master",
                          "natxet/CssMin": "dev-master"
                      },
                      "autoload": {
                          "classmap": [
                              "app/commands",
                              "app/controllers",
                              "app/models",
                              "app/database/migrations",
                              "app/database/seeds",
                              "app/tests/TestCase.php",
                              "app/libraries"
                          ]
                      },
                      "scripts": {
                          "post-install-cmd": [
                              "php artisan optimize"
                          ],
                          "pre-update-cmd": [
                              "php artisan clear-compiled"
                          ],
                          "post-update-cmd": [
                              "php artisan optimize"
                          ],
                          "post-create-project-cmd": [
                              "php artisan key:generate"
                          ]
                      },
                      "config": {
                          "preferred-install": "dist"
                      },
                      "minimum-stability": "dev"
                  }
                  

                  推荐答案

                  在继续之前,请始终确保您运行的是最新版本的composer,您可以通过composer self-update进行更新代码>

                  Before going any further always make sure you're running the latest version of composer, you can update it via composer self-update

                  当您运行 composer update 时,它会为您的每个库(或最新版本)计算最新的 gitref,然后安装该版本的库.然后它将这些版本存储在 composer.lock 文件中.

                  When you run composer update it will calculate the most up-to-date gitref for each of your libraries (or the latest release) and then will install that version of the library. It will then store these versions in the composer.lock file.

                  当您运行 composer install 时,它只会安装 composer.lock 文件中定义的版本.

                  When you run composer install, it simply installs the versions defined in the composer.lock file.

                  composer update 需要这么长时间并使用这么多内存的原因是因为它必须跟踪每个库的版本,将其与您在 composer.json 中定义的版本进行比较 然后检查该库的所有依赖项.这是一个相当密集的过程.

                  The reason composer update takes so long and uses so much memory is because it has to trace every library's version, compare it with the version you have defined in your composer.json and then check all of that library's dependencies. This is quite an intensive process.

                  我发现使用 hhvm 运行 composer(你可以安装它 here) 大大加快了 composer update 进程.

                  I find that running composer using hhvm (you can install it here) speeds up the composer update process massively.

                  除此之外,您只需要忍受高内存使用并在 php.ini 文件中增加它.确保更新与 CLI 相关的那个.

                  Short of that, you just have to live with the high memory usage and increase it in your php.ini file. Make sure you update the one that is relevant for your CLI.

                  您不应该在生产环境中运行 composer update.您应该只在开发时更新您的依赖项,然后在生产环境中使用 composer install 安装您最后使用的一组 composer 依赖项.

                  You should never run composer update in the production environment. You should only update your dependencies when you're developing, and then use composer install to install your last used set of composer dependencies when you're in a production environment.

                  这篇关于作曲家在每个项目上都内存不足,Mac OS X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:开发中的 Laravel 和视图缓存 - 无法立即看到更改 下一篇:Laravel:迁移与为生产数据播种

                  相关文章

                      <small id='df4fw'></small><noframes id='df4fw'>

                      <legend id='df4fw'><style id='df4fw'><dir id='df4fw'><q id='df4fw'></q></dir></style></legend>
                      • <bdo id='df4fw'></bdo><ul id='df4fw'></ul>
                    1. <tfoot id='df4fw'></tfoot>
                    2. <i id='df4fw'><tr id='df4fw'><dt id='df4fw'><q id='df4fw'><span id='df4fw'><b id='df4fw'><form id='df4fw'><ins id='df4fw'></ins><ul id='df4fw'></ul><sub id='df4fw'></sub></form><legend id='df4fw'></legend><bdo id='df4fw'><pre id='df4fw'><center id='df4fw'></center></pre></bdo></b><th id='df4fw'></th></span></q></dt></tr></i><div id='df4fw'><tfoot id='df4fw'></tfoot><dl id='df4fw'><fieldset id='df4fw'></fieldset></dl></div>