PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 19, 2022

[FIXED] Why is composer not adding a package?

 February 19, 2022     composer-php, php     No comments   

Issue

I'm trying to add a new composer dependency to my project, but it doesn't work. There's no error or anything - it just silently does nothing:

[vagrant@localhost project]$ composer require bshaffer/oauth2-server-bundle
Using version ^0.4.0 for bshaffer/oauth2-server-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

[vagrant@localhost project]$ composer update --verbose
Loading composer repositories with package information
Updating dependencies (including require-dev)

That's it. That's all the output. What is going on? Why isn't composer downloading and installing the package?

Additional info:

  • The machine has PHP 5.6 installed.
  • The project has Symfony 2.8 installed and a bunch of other libraries.
  • There is a composer.lock file, but no matter what I do, the bshaffer/oauth2-server-bundle doesn't get added to it. I'm afraid to completely delete and recreate the file.
  • Deleting vendor/ and other auto-generate files, and then running composer install results in all the libraries being reinstalled except bshaffer/oauth2-server-bundle.

Solution

It was a memory issue after all. The project is in a virtual machine with 2GB of RAM allocated. Since there is basically nothing else there, that's enough for smooth daily operation. Except composer, apparently. I increased the amount of available RAM to the VM, and here are the results:

  • At 2GB - terminates silently, no error messages or anything
  • At 4GB - terminates with an error message that there's not enough memory to fork.
  • At 8GB - Works as expected, woohoo!

Seriously, 8GB? Bloatware these days! When I grew up...



Answered By - Vilx-
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing