Guide: User Guide | Section: Repositories / Composer
This page covers how to configure PHP Composer to install dependencies from and publish packages to Pantera.
- PHP 8.x with Composer 2.x
- A Pantera account with a JWT token (see Getting Started)
- The Pantera hostname and port (default:
pantera-host:8080)
Add Pantera as a Composer repository in your project's composer.json:
{
"repositories": [
{
"type": "composer",
"url": "http://pantera-host:8080/php-group"
}
],
"config": {
"secure-http": false
}
}Set secure-http to false only if your Pantera instance does not use HTTPS.
Create or edit ~/.composer/auth.json:
{
"http-basic": {
"pantera-host:8080": {
"username": "your-username",
"password": "your-jwt-token"
}
}
}Or set it via the command line:
composer config --global http-basic.pantera-host:8080 your-username your-jwt-tokenOnce configured, standard Composer commands work as expected:
composer install
composer update
composer require vendor/packagePantera resolves packages through the group repository, checking your local repository first and then falling through to the proxied upstream (Packagist).
curl -X PUT \
-H "Authorization: Basic $(echo -n your-username:your-jwt-token | base64)" \
--data-binary @my-package-1.0.0.zip \
http://pantera-host:8080/php-local/my-package-1.0.0.zipThe local Composer repository indexes uploaded archives and makes them available for composer require.
| Symptom | Cause | Fix |
|---|---|---|
401 Unauthorized |
Expired token or missing auth | Update auth.json with a fresh JWT token |
The "http://..." file could not be downloaded (HTTP/1.1 404) |
Package not in local repo and not cached from upstream | Verify the group repository includes a proxy member |
curl error 60: SSL certificate problem |
HTTPS verification failure | Set "secure-http": false in composer.json (non-HTTPS) or install proper certs |
| Package found on Packagist but not resolving | Proxy not configured for packagist.org | Ask admin to verify the php-proxy remote URL |
Your requirements could not be resolved |
Dependency conflict, not a Pantera issue | Run composer update --with-all-dependencies to resolve conflicts |
Server-Side Repository Configuration (Admin Reference)
Local repository:
# php-local.yaml
repo:
type: php
storage:
type: fs
path: /var/pantera/data
url: http://pantera-host:8080/php-localProxy repository:
# php-proxy.yaml
repo:
type: php-proxy
url: http://pantera-host:8080/php-proxy
storage:
type: fs
path: /var/pantera/data
remotes:
- url: https://repo.packagist.orgGroup repository:
# php-group.yaml
repo:
type: php-group
members:
- php-local
- php-proxy
url: http://pantera-host:8080/php-group- Getting Started -- Obtaining JWT tokens
- Troubleshooting -- Common error resolution