Composer: PHP Fatal error: Allowed memory size exhausted

PHP Fatal error: Allowed memory size exhausted

This is a common issue that happens during composer install or update. In-order to solve this issue we need to increase the memory limit of PHP temporarily.

Step1: Find out the full path to composer binary.

#which composer
  /usr/local/bin/composer

Note that this path may vary according to the server configurations.

Step2: Run the composer command as following.

#php -d memory_limit=1024M /usr/local/bin/composer update

Note that here we need to update the full path to composer binary that got from step1. Sometimes it requires more than 1024M to resolve this problem. The same syntax can be used for composer install in case of this error.

That's all….

Leave a Reply

Your email address will not be published. Required fields are marked *