Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

obink's avatar
Level 1

Composer Memory_Limit allowed size 1610612736

I'm trying to include laravel/spatie inside my project but can't make any progress because of composer memory limit.

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

and I'm using wamp for PHP, and this is my PHP version

PHP 7.3.12 (cli) (built: Nov 19 2019 13:58:02) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies

I already change php.ini file and restarting wamp memory_limit = -1

and trying several times after changing this and that about composer and keep getting another error message like,

php COMPOSER_MEMORY_LIMIT=-1
Could not open input file: COMPOSER_MEMORY_LIMIT=-1
php composer.phar COMPOSER_MEMORY_LIMIT=-1
Could not open input file: composer.phar

I googled it and some people make this right with the above tricks, anyone like me, or is it just me?

have anyone done this before?

0 likes
4 replies
obink's avatar
obink
OP
Best Answer
Level 1

After all that I did, finally, I used Git Bash to do this

COMPOSER_MEMORY_LIMIT=-1 composer -v require spatie/laravel-permission

and it worked. I used CMD from windows from all the time, so git bash is the clue.

Please or to participate in this conversation.