作曲家更新=>致命错误:内存不足

时间:2018-09-29 17:34:19

标签: php symfony composer-php

我在本地计算机上使用XAMPP。我无法通过取消PHP内存限制来解决此问题。

我已经尝试过的东西:

  • 修改了我的php.ini以删除内存限制=> memory_limit = -1

  • 检查我正在运行PHP 5.6

  • 并自动更新为最新版本的作曲家

但是它似乎根本没有任何作用。有人有建议吗?

我的composer.json

{
    "name": "erwin/symff",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-4": {
            "AppBundle\\": "src/AppBundle"
        },
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        },
        "files": [
            "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
        ]
    },
    "require": {
        "php": ">=5.5.9",
        "bmatzner/fontawesome-bundle": "~4.4",
        "bmatzner/jquery-bundle": "~1.9",
        "bmatzner/jquery-mobile-bundle": "~1.4.5",
        "bmatzner/jquery-ui-bundle": "~1.10.3",
        "boekkooi/jquery-validation-bundle": "~1.2.1",
        "divi/ajax-login-bundle": "dev-master",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-fixtures-bundle": "^3.0.2",
        "doctrine/orm": "^2.5",
        "egeloen/google-map-bundle": "^3.0.1",
        "egeloen/serializer-bundle": "^1.0.0",
        "friendsofsymfony/comment-bundle": "^2.2.0",
        "friendsofsymfony/jsrouting-bundle": "^2.2.1",
        "friendsofsymfony/user-bundle": "^2.1.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "ivkos/pushbullet": "^3.3.0",
        "javiereguiluz/easyadmin-bundle": "^1.17",
        "jmose/command-scheduler-bundle": "^2.0.0",
        "jms/security-extra-bundle": "^1.6.1",
        "php-http/guzzle6-adapter": "^1.1.1",
        "php-http/httplug-bundle": "^1.11.0",
        "rapidwebltd/php-google-contacts-v3-api": "^2.0.0",
        "sensio/distribution-bundle": "^5.0.19",
        "sensio/framework-extra-bundle": "^3.0.2",
        "symfony/assetic-bundle": "dev-master",
        "symfony/monolog-bundle": "^3.1.0",
        "symfony/polyfill-apcu": "^1.0",
        "symfony/swiftmailer-bundle": "^2.3.10",
        "symfony/symfony": "3.4.*",
        "twig/extensions": "1.0.*",
        "twig/twig": "^1.0||^2.0",
        "vich/uploader-bundle": "^1.0.1"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.0"
    },
    "scripts": {
        "symfony-scripts": [
            "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",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-install-cmd": [
            "@symfony-scripts"
        ],
        "post-update-cmd": [
            "@symfony-scripts"
        ]
    },
    "config": {
        "sort-packages": true
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": null
    }
}

当我运行此命令时:

composer update

我得到以下输出:

"C:\DEV\xampp\php\php.exe" "C:\DEV\xampp\htdocs\symfony\composer.phar" "--ansi" "--no-interaction" "update"
Loading composer repositories with package information
Updating dependencies (including require-dev)

Fatal error: Out of memory (allocated 1584922624) (tried to allocate 268435456 bytes) in phar://C:/DEV/xampp/htdocs/symfony/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220
PHP Fatal error:  Out of memory (allocated 1584922624) (tried to allocate 268435456 bytes) in phar://C:/DEV/xampp/htdocs/symfony/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220

我希望这会发生:

以前曾经发生过的简单更新。

编辑:

据我了解,“内存不足”错误似乎表示物理内存限制,而不是配置的限制。

Windows上的PHP是32位(我认为至少是……),并且32位进程不能使用超过2GB的RAM。

所以我想我遇到了一个实际的身体限制。

我现在的问题是:我如何仍然可以在32位PHP上更新我的软件包?

我尝试了更新每个包的方法

C:\DEV\xampp\htdocs\symfony>php -d memory_limit=-1 composer.phar update bmatzner/fontawesome-bundle
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error:  Out of memory (allocated 1592000512) (tried to allocate 268435456 bytes) in phar://C:/DEV/xampp/htdocs/symfony/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220

但是如您所见,我遇到了同样的问题。

2 个答案:

答案 0 :(得分:1)

升级到PHP7可以达到目的。

在RAM消耗方面似乎更有效率。

感谢所有在这里帮助我的人。

答案 1 :(得分:0)

使用更大的内存限制更新作曲家

php -dmemory_limit=3G /usr/local/bin/composer update