How to install a specific version of package using Composer?

0 votes
I am trying to install a specific version of a package using Composer. I tried composer install and composer require but they are installing the latest version of the package. What if I want an older version?
Apr 1 in PHP by kartik
• 26,540 points
282 views

1 answer to this question.

0 votes

Hello,

Just use php composer.phar require

For example :

php composer.phar require doctrine/mongodb-odm-bundle 3.0

Also available with install.

https://getcomposer.org/doc/03-cli.md#require https://getcomposer.org/doc/03-cli.md#install

Hope this works fine!!

Thank you!

answered Apr 1 by Niroj
• 57,260 points

Related Questions In PHP

0 votes
1 answer

How to insert multiple rows from a single query using eloquent/fluent?

Hello @kartik, You can use the following approach. $data ...READ MORE

answered Aug 14 in PHP by Niroj
• 57,260 points
43 views
0 votes
1 answer

How to get the sizes of the tables of a MySQL database?

Hello @kartik, You can use this query to ...READ MORE

answered Aug 18 in PHP by Niroj
• 57,260 points
51 views
0 votes
1 answer

How to zip a whole folder using PHP?

Hello @kartik, You can Zip a whole folder using ...READ MORE

answered Aug 24 in PHP by Niroj
• 57,260 points
27 views
0 votes
1 answer

How to resolve the problem of losing a session after a redirect in PHP?

Hello @kartik, Carry out these usual checks: Make sure session_start(); is ...READ MORE

answered Aug 24 in PHP by Niroj
• 57,260 points
154 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 57,260 points
2,090 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18 in Laravel by Niroj
• 57,260 points
218 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23 in Laravel by Niroj
• 57,260 points
181 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23 in Laravel by Niroj
• 57,260 points
2,490 views
0 votes
1 answer

How to get a list of user accounts using the command line in MySQL?

Hello @kartik, Use this query: SELECT User FROM mysql.user; Which ...READ MORE

answered Aug 17 in PHP by Niroj
• 57,260 points
30 views
0 votes
1 answer

How can I connect to a Tor hidden service using CURL in PHP?

Hello @kartik, I use Privoxy and cURL to scrape Tor ...READ MORE

answered May 19 in PHP by Niroj
• 57,260 points
493 views