cancel
Showing results for 
Search instead for 
Did you mean: 

Composer Memory Limits error

Composer Memory Limits error

hi guys, i got this error when i want install this lib.

 

[foodyolr@lsv3 www]$ composer require mpdf/mpdf
Using version ^8.0 for mpdf/mpdf
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

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

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.[foodyolr@lsv3 www]$

 

2 REPLIES 2

Re: Composer Memory Limits error

@cryezzis875211 

 

Composer may sometimes fail on some commands with this message:

PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>

In this case, the PHP memory_limit should be increased.

Note: Composer internally increases the memory_limit to 1.5G.

To get the current memory_limit value, run:

php -r "echo ini_get('memory_limit').PHP_EOL;"

Try increasing the limit in your php.ini file (ex. /etc/php5/cli/php.ini for Debian-like systems):

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

Composer also respects a memory limit defined by the COMPOSER_MEMORY_LIMIT environment variable:

COMPOSER_MEMORY_LIMIT=-1 composer.phar <...>

Or, you can increase the limit with a command-line argument:

php -d memory_limit=-1 composer.phar <...>
Manish Mittal
https://www.manishmittal.com/

Re: Composer Memory Limits error

hi thank you for the support, but in my case i got a fatal error when i want send an attachment on invoice email template.

mpdf /mpdf is missing i think