11

I tried to execute:

composer.phar update

And received:

Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 71 bytes) in phar:///home/xxxxxxx/bin/composer.phar/src/Composer/DependencyResolver/RuleSetGenerator.php on line 123

The xxxxxxx is the user.

And then I tried to execute:

php -d memory_limit=256M ~/bin/composer.phar update

And:

php -d memory_limit=512M ~/bin/composer.phar update

Then I received this:

Yikes! One of your processes (php, pid 14331) was just killed for excessive resource usage. Please contact DreamHost Support for details.**

How can I execute composer update on Dreamhost shared host? Can someone who had experienced this situation could help me please?

The context: Laravel 4

Rubens Mariuzzo
  • 28,358
  • 27
  • 121
  • 148
Undefined Behavior
  • 2,128
  • 4
  • 24
  • 34
  • beware, dreamhost shared host alow to install composer, but the host is too slow to run "composer update". No make sense it, you can install but impossible to use. – Undefined Behavior Jul 24 '13 at 14:19
  • 1
    the response from Dreamhost: "I'm afraid that it may be best to look into using our VPS service. The processes coming from your account are too high to stay on our shared plan. Here's a link with information on our VPS service if needed." the end of story: the command "composer update" its impossible to use in dreamhost shared host because the server is too slow and limited, bad host. – Undefined Behavior Jul 24 '13 at 18:29
  • 1
    I was able to install Laravel 4 two months ago using composer... but now I retried and process got killed... – Rubens Mariuzzo Oct 04 '13 at 00:58
  • @RubensMariuzzo Same here, this was definately working for me in October because I used the shared hosting to develop a site in Laravel. I just tried now and I get the same problem as OP. – Jeemusu Feb 11 '14 at 15:40

2 Answers2

39

Run the composer update command on your development machine, which generates the composer.lock file for you. Upload that composer.lock file and on the shared host just run composer install. This will use a lot less memory!

Burak Erdem
  • 19,630
  • 7
  • 36
  • 56
  • This could solve the issue, and be correct to live but don't actually explain why its failing and that shouldn't! – Luis Lopes Nov 14 '16 at 17:36
  • working..upload local composer.lock file on server and run composer install command – Savoo Feb 28 '17 at 10:54
2

It happens for a lack of memory of your server.

  1. You can install the package in your local machine
  2. Then replace your server composer.lock file with the local's composer.lock file (or push the composer.lock file from local and pull the composer.lock file in the server)
  3. Then go to the terminal and run composer update or composer install.