Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to update the thinkphp version through composer

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to update the thinkphp version through composer, the article is very detailed, has a certain reference value, interested friends must read it!

Process

Upgrade from tp5.1.19 to tp5.1.26.

Go to the project root directory and enter composer update to expect to update to the latest version, but prompt that there is nothing to update. Try to clear the cache composer clear-cache, but it still doesn't work. Seeing the hint on the official website that there is a problem with the phpcomposer image recently, I remember that I used to switch to the Chinese mirror and switch back to the root mirror.

Composer config-g repo.packagist composer https://packagist.org

After clearing the cache, enter composer update to update successfully.

Understanding & explanation

The role of caching: I download a version of a package and repeat it in a short period of time (update or create a new project in another project), which is much faster because it is downloaded from the local cache rather than from the package repository.

Default version of composer update package: take topthink/framework package as an example. Composer update or composer create-project are not followed by a specified version number. What you download is the version seen here, that is, search topthink/framework from the php package warehouse and click into it to see the version.

The tp manual indicates that composer is installing the latest stable version. If you want to install the latest real-time version, type

Composer create-project topthink/think=5.1.x-dev tp5

Note that the x here does not allow you to fill in the latest version or the desired version, but 5.1.x-dev is a version of the package, representing the latest version of 5.1. If you want to download the specified version, you should go to the package warehouse to see it.

Note: some packages have v before the version, such as v5.1.26, while others do not, directly 5.1.26. The details of the package in the package warehouse shall prevail. If there is a v, enter to forget v, will prompt that there is no this version.

Composer command

Globally switch mirrors

Composer config-g image

View composer settings

Composer config-l

Clear cach

Composer clear-cache

Update composer

Composer self-update above is all the contents of the article "how to update the thinkphp version through composer". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 285

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report