Composer Returning Memory Allocation Error

Asked

Viewed 5,677 times

2

I just installed Composer and I am trying to download some files from sendgrid, however it is returning me memory error. Someone knows what’s causing this and how to fix it?

Installing sendgrid/php-http-client (3.1.0): Loading from cache
    proc_open(): fork failed - Cannot allocate memory
    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

PHP Warning:  proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 959

Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 959

  [ErrorException]
  proc_open(): fork failed - Cannot allocate memory


require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...
  • Which modules are installed in php? There is zip extension

  • It seems it was a memory problem, I had to activate a swap

2 answers

15


  • 1

    Your reply helped me to continue with the sudo composer update who was crashing for the same reason.

0

The @Ronaldom solution may not work if the amount of memory needed to run the Composer script is greater than your swap RAM + 1024.

In that case grow count=1024 for another value, such as: count=2048.

Especially for those who are having this mistake in a instance of the AWS, and can not run a script in any way, remember that you can increase / decrease without difficulty temporarily the RAM of your instance by upgrading / downgrade the type of instance.

For this in the Instances menu:

  • select your instance

click on:

Access the machine and run the Poser, repeat the above steps to downgrade.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.