Composer update cannot allocate memory

Avatar
  • Answered
I have Laravel 5 installed and am trying to use the composer update command via SSH. When I run the command, I get an error: mmap() failed: [12] Cannot allocate memory.
I tried updating my php.ini file to 4G (also tried -1) and added an .htaccess file with a suPHP_ConfigPath line as suggested elsewhere. Still getting the memory error. Any suggestions?
Avatar
Tim S.
Hi, try changing the php version to 5.6 and test it. I've read through a few forums and they have seen this error with php7+ but seems to work fine with 5.6

Let me know the outcome.
Avatar
Tim S.
Good morning,

Thanks for your question about Laravel and not being able to allocate memory. I would suggest trying to change your PHP version. Reading up on the error, it looks like this is the easiest solution. It's not that your running out of memory so changing it doesn't fix the issue. The issue is it cannot allocate the memory properly. Look at the PHP version you are using and try using a newer version.

I hope this helps!

Thanks!

Tim S