# Composer

Composer is a digital tool that automatically finds and organises all the necessary components needed to build a PHP-based website. It is open source and self-hosted, installable on Docker Hub.

Canonical page: https://ourlocalhost.com/app/5677/composer

## Description

Composer is a digital tool that automatically finds and organises all the necessary components needed to build a PHP-based website. It ensures your projects have the correct building blocks and keeps them updated, saving you from manually downloading and managing individual pieces of software.

## Platform availability

Available on 0 of 10 platforms.

## Health score

77/100 (Good), based on 4 of 5 factors.
- Maintained: 100 (last commit 8 days ago)
- Popular: 89 (29,581 GitHub stars)
- Easy to install: 25 (0 install platforms, install notes, Docker image)
- Security check: 69 (no serious findings, OpenSSF Scorecard 5.9/10)

## Links

- GitHub: https://github.com/composer/composer
- Docker Hub: https://hub.docker.com/r/islandora/composer
- Official website: https://getcomposer.org/
- Documentation: https://getcomposer.org/doc/

## Common questions

### How can I update Composer to a version that matches my PHP setup?

Run the Composer installer or the self-update command. It should automatically select the appropriate Composer version for your PHP.

### What should I do first when Composer commands fail?

Make sure you are using the latest version, then run composer diagnose to check for common problems. If all checks pass, continue troubleshooting from there.

### How do I install dependencies for a PHP project?

In the project folder, run php composer.phar install so Composer uses composer.json and saves exact versions in composer.lock. Skipping this can leave the vendor folder incomplete and crash the app.

### Why can't my terminal find a command installed globally with Composer?

Add Composer's global binary folder to your PATH. Without that, the terminal will not find the installed command.

### What private or self-hosted registry options have self-hosters mentioned for Composer packages?

A self-hoster mentioned Packagist and GitLab as possible private or self-hosted registry options. Packagist was described as recommended, with cloud pricing noted as about 1k per year or per user.

## Alternatives

- npm: npm is a package manager for Node.js that is run through the command line and manages dependencies for an application.

---
Source: Our Local Host (https://ourlocalhost.com/app/5677/composer), the self-hosted and open-source app directory.
