centrifugal / phpcent

PHP library to communicate with Centrifugo HTTP API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal error: Allowed memory size during the installation

devig opened this issue · comments

commented

php 7.4.9
composer 1.10.17
Debian 10
RAM 4G

did this
composer require centrifugal/phpcent:~3.0

and got this
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 528384 bytes) in phar:///home/admin/.composer/composer/src/Composer/DependencyResolver/Pool.php on line 214

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 528384 bytes) in phar:///home/admin/.composer/composer/src/Composer/DependencyResolver/Pool.php on line 214

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

I tried to do
COMPOSER_MEMORY_LIMIT=3G composer require centrifugal/phpcent
COMPOSER_MEMORY_LIMIT=-1 composer require centrifugal/phpcent
set memory_limit = 3G in php.ini
set memory_limit = -1 in php.ini

and got
mmap() failed: [12] Cannot allocate memory

commented

Solution:

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/bin/chmod 0600 /var/swap.1
/sbin/swapon /var/swap.1

Hello, thanks - maybe this will help future users. As far as I understand this is mostly related to composer - not directly phpcent, so I suppose this is safe to close.