To update your package on Packagist, first ensure your composer.json is updated with the correct version, dependencies, and metadata, then commit and push changes to your repository. 1. Update composer.json with necessary changes such as version, dependencies, or metadata and commit it. 2. Tag your release using Git (e.g., git tag 1.2.3) and push tags to the remote repository. 3. Push changes to your default branch (e.g., git push origin main). 4. Optionally, manually trigger an update via the Packagist website or API if auto-update doesn’t occur. Common issues include incorrect tagging, missing composer.json, or wrong branch settings, so double-check these if updates don’t appear.
Updating your package on Packagist is pretty straightforward, especially if you're already using GitHub (or a similar platform) to manage your PHP project. The key idea is that Packagist pulls in package info from your composer.json
file, so the main steps involve updating that file and triggering a re-fetch.
Here’s how to do it smoothly.
Make Sure Your composer.json
Is Up to Date
Before pushing changes to Packagist, double-check your composer.json
. This includes:
- Updating the version number if needed (though many rely on Git tags instead)
- Adding or modifying dependencies
- Correcting any metadata like description, keywords, or license
Don’t forget to commit this file after making changes.
If you're using semantic versioning, tag your release in Git:
git tag 1.2.3 git push --tags
This helps Packagist recognize new versions automatically.
Push Changes to Your Repository
Once your composer.json
is updated and committed, just push to your remote repository (like GitHub, GitLab, etc.) as usual:
git push origin main
If you've added a new tag for a version, make sure that's pushed too:
git push origin 1.2.3
Packagist usually detects updates when:
- A new tag is pushed
- The default branch (e.g.,
main
) is updated - Or you manually trigger an update (see below)
Trigger an Update on Packagist (Optional)
If your repo is connected via the Packagist hook (which it probably is if you submitted it before), it should auto-update within a few minutes.
But sometimes you might want to force it:
- Go to http://ipnx.cn/link/df543abd114ce563a23341c8a0707de6
- Log into your account
- Find your package and click "Update"
You can also use the Packagist API to trigger updates programmatically if you're automating releases.
Common Gotchas
- Tags not showing up? Make sure they follow semantic versioning and start with a number.
- Composer.json missing? That’s a hard requirement — without it, Packagist won’t recognize your package.
- Wrong branch being used? You can set the default branch on Packagist manually if needed.
That’s basically all there is to it. Keep your repo clean, tag sensibly, and let Packagist do its thing. It’s simple once everything’s wired up right.
The above is the detailed content of How do I update my package on Packagist?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

When using Composer in a production environment, you need to pay attention to safety, stability and performance. 1. Use composerinstall-no-dev to reduce unnecessary development dependencies and reduce online environment risks; 2. Always submit and rely on composer.lock files to ensure version consistency, and avoid using updates during deployment; 3. Optional configuration platform-check=false ignores platform differences warnings, which is suitable for building packaging scenarios; 4. Enable APCU to accelerate automatic loading to improve performance, especially suitable for high concurrency services, while paying attention to namespace uniqueness to avoid cache conflicts.

To check whether Composer is installed correctly, first run the composer--version command to view the version information. If the version number is displayed, it means that it is installed. Secondly, use the composerdiagnose command to detect configuration problems and ensure that the environment variables and permissions are normal. Finally, try to verify the functional integrity through the composerrequiremonolog/monolog installation package. If the vendor directory is successfully created and the dependency is downloaded, it means that Composer is fully available. If the above steps fail, you may need to check whether PHP has been installed globally or adjusted system path settings.

To install the Composer plug-in, please first confirm that Composer is installed and the composer.json file exists, and then follow the following steps: 1. Make sure that Composer has been installed and created composer.json; 2. Search and copy the required plug-in name on Packagist; 3. Use the composerrequirequire command to install the plug-in, such as composerrequiredealerdirect/phpcodesniffer-composer-installer; 4. Verify whether the plug-in is effective and check compatibility and configuration. Follow these steps to correctly install the Composer plug-in.

To add a custom repository to the Composer configuration, edit the composer.json file in the project and specify the repository information under the "repositories" key. The specific steps are as follows: 1. Determine the repository type, such as VCS (Git, SVN, etc.), Composer, PEAR or Package; 2. Add the "repositories" block in composer.json and fill in the repository type and URL. For example, when using a VCS-type Git repository, the format is {"type":"vcs","url":"https

ToupdateyourpackageonPackagist,firstensureyourcomposer.jsonisupdatedwiththecorrectversion,dependencies,andmetadata,thencommitandpushchangestoyourrepository.1.Updatecomposer.jsonwithnecessarychangessuchasversion,dependencies,ormetadataandcommitit.2.Ta

To add dependencies to composer.json, the most common method is to use the composerrequire command, followed by manually editing the composer.json file. 1. Use composerrequiredor/package to automatically add the latest stable version dependencies and install them; 2. You can specify the version such as composerrequiredor/package: 1.2.3 or use the constraint character such as ^2.0; 3. This command will synchronize the update of composer.json and composer.lock and automatically handle the dependencies; 4. Manually edit suitable for batch addition or template projects, you need to maintain the version yourself and run c

When you encounter the "Yourplatformdoesnotatsatisfythatrequirement" error, you can use the --ignore-platform-reqs parameter to ignore the platform requirements for installation. The full name of this parameter is --ignore-platform-requirements. It is used to skip the PHP version, extension and other checks specified in composer.json when executing composerinstall or update. For example, if the current PHP version is 8.0 but the configuration requires 8.1, an error will be reported by default. If you add this parameter, the check will be skipped. Applicable scenarios include: 1. Local environment and true in containerized deployment or CI environment

TouseaprivateComposerrepository,configurecomposer.jsonwiththecorrectrepositoryURL,handleauthenticationsecurelyviaSSHorHTTPS,andensurepackagesareaccessible.First,addtherepositoryincomposer.jsonusingeitheraVCStypeforGitrepositoriesoraComposertypeforpri
