Home > Article > Backend Development > How to Install Specific Package Versions with Composer?
Installing Specific Package Versions with Composer
Composer is a dependency manager for PHP that simplifies the installation and management of third-party packages. When installing a package, Composer typically installs the latest available version by default. However, there may be scenarios where a specific version of a package is required. This article provides a solution for installing a specific version of a package using Composer.
To install a specific version of a package, use the following syntax:
composer require vendor/package:version
In this syntax, "vendor/package" represents the vendor and package name, and "version" specifies the desired version. For example, to install version 0.10.2 of the "refinery29/test-util" package, use the following command:
composer require refinery29/test-util:0.10.2
By using this method, you can precisely control the version of a package installed in your project, ensuring compatibility with other dependencies or specific project requirements.
The above is the detailed content of How to Install Specific Package Versions with Composer?. For more information, please follow other related articles on the PHP Chinese website!