How to use a specific tag/version with composer and a private git repository?

How to require a specific Git tag? Change the version requirement to dev-master, followed by a hash # and the Git tag name, e.g. v0.5.0, like so: “require”: { “vendor/package”: “dev-master#v0.5.0” } How to require a specific Git commit? Change the version requirement to dev-master, followed by a hash # and the Git commit reference, … Read more

Composer [UnexpectedValueException] error will trying to use composer to install a github project

I started getting a similar error and the reason was that Github recently changed the format of their auth tokens: Authentication token format updates are generally available To resolve the error: Find the composer/auth.json file (if you’re running the project in a container, you’ll have to bash into it and find the file in there) … Read more

Composer Content-Length Mismatch

First, run: composer config –list –global //this will get the composer home path. [home] /root/.composer //it’s my composer home path. And then, edit the config.json, make it like this: { “config”: { “github-protocols”: [ “https” ] }, “repositories”: { “packagist.org”: { “type”: “composer”, “url”: “https://packagist.org” } } } It will make the packagist connection force … Read more

What is the difference between require and require-dev sections in composer.json?

Different Environments Typically, software will run in different environments: development testing staging production Different Dependencies in Different Environments The dependencies which are declared in the require section of composer.json are typically dependencies which are required for running an application or a package in staging production environments, whereas the dependencies declared in the require-dev section are … Read more

How to resolve a “Can only install one of:” conflict?

The “Can only install one [x, y]” message appears when two different packages point to the same dependency, but different major, mutually exclusive versions where only one can be installed. Troubleshooting For example, one version can be “locked at” due to the information present in your composer.lock file which may conflict with what you’re trying … Read more