1

I used composer to install pimcore. Right now I am attempting to add routing for a new theme I'm using, but I reach a routing error. Based on symfony's documentation I realized I need to run composer require annotations but I get hit with this error:

[InvalidArgumentException]
  Could not find package annotations.

  Did you mean one of these?
  minime/annotations
  zeptech/annotations
  ray/di
  jms/metadata
  jms/aop-bundle

after some looking around, I see that I first need to run composer require sensio/framework-extra-bundle. However, when I run it, after some time, I get hit with

mmap() failed: [12] Cannot allocate memory

mmap() failed: [12] Cannot allocate memory
PHP Fatal error:  Out of memory (allocated 2929729536) (tried to allocate 4096 bytes) in 
phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129

Fatal error: Out of memory (allocated 2929729536) (tried to allocate 4096 bytes) in 
phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129

I'm realizing this is a memory issue, there are currently 3GB of memory on the server (running via DigitalOcean). What are my options? Running Ubuntu 16.04 btw.

I should add that my memory limit in php.ini is set to -1.

Amr H
  • 58
  • 1
  • 9
  • I also get the same memory error when I try to run `composer update` – Amr H Jul 29 '20 at 17:16
  • 1
    Does this answer your question? [PHP Composer update "cannot allocate memory" error (using Laravel 4)](https://stackoverflow.com/questions/18116261/php-composer-update-cannot-allocate-memory-error-using-laravel-4) – rob006 Jul 29 '20 at 18:49

2 Answers2

1

That is because PHP is running with a memory limit by default. You can by-pass it by running the following command.

php -d memory_limit=-1 /usr/local/bin/composer install

Another option would be updating your php.ini files and setting the memory_limit = -1.

Meh Di
  • 93
  • 1
  • 10
  • Already made sure of that before posting the question, thanks though. I figured it out, I posted the solution – Amr H Jul 29 '20 at 17:27
0

Update: I solved it by running

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

to add 4 GB of memory from the hard drive.

Then I just run my command and it updated the framework with no problem. Hope this helps someone

Amr H
  • 58
  • 1
  • 9