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 use Composer2

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

Share

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

This article mainly introduces the use of Composer2, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Update a project to Laravel 8, and after adjusting the dependency version, when running composer update, the damn fatal error about insufficient memory occurs again:

PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes)

It feels like it will never be satisfied. Conditioned to find a solution first, of course, I know what to do, but forgot the command. During the search, it reminds me of Composer 2. I remember saying that it has a "smaller memory footprint" and that the upgrade and fallback versions are convenient, so give it a try and upgrade it immediately:

Composer self-update-2Updating to version 2.0.8 (2.x channel). Downloading (100%) Use composer self-update-rollback to return to version 1.10.19

The upgrade is completed in the slot, and then the update package command is executed, this time there is no error, and the package begins to be installed one by one. Through the use of this package installation, give me a few intuitive feelings:

In terms of progress, v1 takes a long time to analyze, and then the installation is completed quickly, while the v2 analysis is fast and the installation progress is output one by one, which feels like a download and installation, but the speed is not slow.

When v1 was installed, the fan of my computer began to accelerate, the sound obviously increased, and the memory footprint increased, while v2 was much calmer.

V2 does not directly display the packages that are recommended for installation and those that require financial support.

Other issues after the upgrade are not known yet, and there is not much feedback on the use of Composer 2. But at least the optimization of memory footprint can greatly reduce or avoid the occurrence of insufficient memory.

Thank you for reading this article carefully. I hope the article "how to use Composer2" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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: 0

*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