Solved Composer Error: Allowed memory size of 1610612736 bytes exhausted

You are getting this error in console when using Composer commands:

PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted (tried to allocate XXXX bytes) in phar...

In this post we will show you ways to solve this Composer memory limit error.

 

Way 1: Increase PHP memory_limit

Open your php.ini configuration file and change memory_limit config as below:

php.ini
; Use -1 for unlimited or define an explicit value like 2G
memory_limit = -1

 

Way 2: Use COMPOSER_MEMORY_LIMIT environment variable

if you do not want to change any config in php.ini, you can use COMPOSER_MEMORY_LIMIT environment variable directly in command line like this:

$ COMPOSER_MEMORY_LIMIT=-1 composer install

 

Let us know if it works for you by adding a comment in below form. Thank you for reading the post.

0 0 vote
Article Rating
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x