How to increase memory limit in php or composer
Memory limit issue can be raised often. And without solving it you can’t process further. You must have to solve this.
Memory limit issue can be raised while installing large amount of software, extension and moreover.
We have two scenarios where we find memory limit issue,
- While installing Magento2, It throws memory limit issue during installation.
- While installing some extension using composer at that time this issue can put you in trouble.
Following are the solutions :-
You can directly set in your php.ini file
memory_limit = 512M
Or, when installing extension in magento 2 using composer,
php -dmemory_limit=-1 -dmax_execution_time=0 /usr/bin/composer require twilio/sdk
php -d memory_limit=-1 composer.phar require aws/aws-sdk-php
php -dmemory_limit=-1 bin/magento setup:di:compile
Try, and let us know if this works for you or not. We will try to solve your issue if this method is not working.