3

When I'm trying to install a new bundle with composer, I'm always running into this problem:

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

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

I tried to raise the memory limit in php.ini and started a whole new project with fresh composer. I should have enough memory on my machine.

Update:

When encountering this problem, also bear in mind that if you change parameters in your PHP.ini, that you've to change them for your PHP CLI. I often forgot that and just changed the php.ini for the version my apache is using...

1

8 Answers 8

6

try
composer clear-cache
before
composer update

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

Comments

3

COMPOSER_MEMORY_LIMIT=-1 to update composer..

COMPOSER_MEMORY_LIMIT=-1 fixed the problem for me while updating/installing packages using composer

Comments

2

This command solved my problem.

php -d memory_limit=-1 /usr/local/bin/composer install

Comments

1

How you test Memory_limit ?

did you restart Apache?

please do the following steps:

with Xampp in Windows 10

just search this phrase: memory_limit

;memory_limit=512M 

by commenting this configuration, in php.ini to:

memory_limit =-1

then restart the Apache by xampp

enter image description here

the result is:

; Maximum amount of memory a script may consume
; http://php.net/memory-limit
memory_limit =-1
;memory_limit=512M

Comments

0

You can do php -d memory_limit=-1 /path/to/composer ... like explained in the doc.

1 Comment

already did that. Did it in the php.ini file as well as with the parameters. There's no othe result
0

I had this error. My solution was to update the self composer $ php composer.phar self-update

2 Comments

Did this as well. Was not helping :( Switched now from a windows machine to linux. No troubles anymore
Could not open input file: composer.phar THIS error appeared when i type it in my command line in windows
0

in windows i used this commands:

php -d memory_limit=-1 C:\composer\composer.phar install

and

php C:\composer\composer.phar self-update

Updating to version 1.10.10 (stable channel).
Downloading (100%)

Use composer self-update --rollback to return to version 1.10.7

Comments

0

Run COMPOSER_MEMORY_LIMIT=-1 composer install instead of composer install. It worked for me.

Comments

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.