php - Composer update `The following exception is caused by a lack of memory and not having swap configured` error in vagrant -


i got php5.5 composer installed in vagrant virtualbox environment.

when try composer's commands following error appears randomly:

the following exception caused lack of memory , not having swap configured

how can around ?

this thread suggest not fix that.

here 2 workarounds. can use each separately or both @ same time.

1st workaround: increase memory limit command

in vagrant machine. increase php memory limit current command. run:

php -dmemory_limit=2g /path/to/composer update 

2nd workaround: increase guest machine memory

add configuration vagrant file, can temporary increase allocated memory:

$memory = env.has_key?('vm_memory') ? env['vm_memory'] : "512"  vagrant.configure("2") |config|     [...]     config.vm.provider "virtualbox" |v|         [...]         v.memory = $memory         [...]     end     [...] end 

then reload vagrant machine follow: vm_memory=2048 vagrant reload

then, in vagrant machine, run composer update.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -