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

What if Composer runs interrupted and displays Killed?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article is to share with you about what to do when Composer is interrupted and what to do with Killed. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Running the Composer installation Drupal module on the Linode VPS of memory 1GB (the maximum running memory allocated to PHP is 128MB) does not prompt for success, only for KILLED.

After increasing the PHP memory from 128MB to 256MB by modifying the running memory allocated to PHP, the error was reported as follows:

Fatal error: Out of memory (allocated 754982912) (tried to allocate 33554440 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSet.php on line 84

Add to 512MB:

Fatal error: Out of memory (allocated 832577536) (tried to allocate 16777216 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

Add it to 768MB and the error report becomes a simple KILLED.

Looks like Composer has a big appetite. What shall I do?

1. The simplest and most effective way is to upgrade the server and add memory to the server. If you really care about money, give up Composer or curve to save the country.

two。 The alternative is to allocate some fake memory to the server to fool the server and learn about the SWAP cache. Great Viagra here is a post: SWAP Q & A: what is SWAP? What's the use of SWAP? How do I use SWAP?

Big Viagra is solved by increasing the server's SWAP cache to 2.5 GB. Of course, the fake is fake after all, and the cache made by the hard disk can certainly not compare with the real memory in performance.

Someone on 3.Stack Overflow also shared a method that might work, but Great Viagra hasn't been tried. That is to run Composer on the local development environment, upload or git push the composer.lock to the production server after success, and then run composer install on the production server.

Instead of looking for the latest version of each package, composer install reads the configuration in the .lock file and pulls down the same version of the package directly. In this way, the demand for memory for composer will be reduced.

However, this method itself is very troublesome, and the success rate is worrying, so you don't have to use it.

Finally, I would like to share with you a way to temporarily lift the memory limit of composer running without modifying the php.ini configuration file:

Php-d memory_limit=-1 / usr/local/bin/composer require/isntall/update

Or:

Php-d memory_limit=-1 `which composer` require/isntall/update Thank you for reading! This is the end of the article on "Composer is interrupted and what to do about Killed" is shared here. I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

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