Автор оригинала: David Wong.
1. Запуск установки composer на виртуальном хосте с низким объемом памяти иногда вызывает ошибку “Следующее исключение вызвано нехваткой памяти и отсутствием конфигурации подкачки” .
This usually occurs on low memory virtual hosts. As the error description shows, there is insufficient memory and no swap memory configuration. This has a special solution in composer official network, [transfer address] [1]
free -m
total used free shared buff/cache available
Mem: 864 372 306 50 185 296
Swap: 0 0 0
# As shown above, Swap is actually 0.
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
# Using free - M again, Swap memory configuration is found
total used free shared buff/cache available
Mem: 864 383 67 49 413 267
Swap: 1023 0 1023
# Run composer install again
2. Случайные команды установки композитора или обновления композитора остаются неизменными в течение длительного времени
Usually, the network is slow and there is no response for a long time. You can print more debugging information by adding - VVV after the command, and you can find that every HTTP request will have output, so you can find out if the network is too slow, and you can use some domestic mirror, portal: [Laravel China] [2] or [Composer Chinese Network] [3]?