3

I'm using XAMPP on a local machine. I couldn't solve this issue by removing the PHP memory limit.

What I already tried :

  • modified my php.ini to remove the memory limit => memory_limit=-1

  • Checked I was running PHP 5.6

  • and self-updated composer to the last version

But it doesn't seem to have any effect at all. Does anyone have a suggestion?

My 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
    }
}

When I run this command:

composer update

I get the following output:

"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

And I expected this to happen:

A simple update as used to happen earlier.

EDIT :

From what I understand, the "Out of memory" error seems to indicate a physical memory limit and not a configured one.

PHP on windows is 32bits (I think so at least...) and 32Bit Processes cannot use more than 2GB of RAM.

So I guess I'm hitting a real physical limitation.

My question now would be : How can I still update my packages on a 32bits PHP ?

I tried updating on a per package approach

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

but as you can see, I encounter the same problem.

23
  • Maybe you server has old timers? Commented Sep 29, 2018 at 17:40
  • And what is "old timers" ? I'm not familiar with this concept. I'm running a local xampp server (PHP 5.6) Commented Sep 29, 2018 at 17:43
  • 1
    modified my php.ini make sure you modified the right ini file, it's not uncommon to have one named php-cli.ini which is specifically used for the Command Line. So it's entirely possible that you modified the one used by Apache (or what have you) and not the one that Composer will be using. Your error stats you have apx 1.5 Gb of memory for PHP. Commented Sep 29, 2018 at 17:43
  • old timers is when you get old and you brain runs out of memory. (it's a Joke) Commented Sep 29, 2018 at 17:44
  • There only seems to be one php.ini file. I just checked this => C:\Users\erwin>php -r "echo ini_get('memory_limit').PHP_EOL;" and got this result => -1 Commented Sep 29, 2018 at 17:46

2 Answers 2

1

Upgrading to PHP7 did the trick.

It seems more efficient when it comes to RAM consumption.

Thanks to everyone who tried to help me here.

Sign up to request clarification or add additional context in comments.

Comments

0

update composer with larger memory limit

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

1 Comment

parameters won't have any effect here. As you can see in my comments, I've already tried it. This error message shows a physical memory limit and not a configured one. Seems like 32Bit Processes cannot use more than 2GB of RAM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.