Home  >  Article  >  Development Tools  >  What should I do if composer gets an error when installing dependencies?

What should I do if composer gets an error when installing dependencies?

藏色散人
藏色散人forward
2020-09-02 11:47:344926browse

The following tutorial column of composer will introduce to you how to deal with errors when composer installs dependencies. I hope it will be helpful to friends in need!

What should I do if composer gets an error when installing dependencies?

What should I do if composer gets an error when installing dependencies?

What should I do if composer gets an error when installing dependencies?

Encountered a lot of pitfalls, here is a summary

Directory

0x01 During installation, composer appeared Killed and was terminated

What should I do if composer gets an error when installing dependencies?0x02 "Your requirements could not" appeared be resolved to an installable set of packages.”

When using the following commands to install composer.json, the following two problems often occur. What should I do if composer gets an error when installing dependencies?

composer install

0x01 During installation, composer appeared Killed and was terminated

The situation may be as follows

This situation is caused by insufficient cache. In Linux, we can increase the cache to solve this problem. What should I do if composer gets an error when installing dependencies?

free -m
mkdir -p /var/_swap_
cd /var/_swap_
dd if=/dev/zero of=swapWhat should I do if composer gets an error when installing dependencies? bs=1M count=2000
mkswap swapWhat should I do if composer gets an error when installing dependencies?
swapon swapWhat should I do if composer gets an error when installing dependencies?
echo "/var/_swap_/swapWhat should I do if composer gets an error when installing dependencies? none swap sw 0 0" >> /etc/fstab
free -m

0x02 composer appears "Your requirements could not be resolved to an installable set of packages."

This kind of error message The situation is generally like this

What should I do if composer gets an error when installing dependencies?

###Although it appears "Your requirements could not be resolved to an installable set of packages.", "You can also run ###php --ini### inside terminal to see which What should I do if composer gets an error when installing dependencies?s are used by PHP in CLI mode." These two prompts, but this is not the focus of our attention. ######What we need to pay attention to is what content is prompted by the middle Problem######For example, in the following situation###############In this case, we just You only need to install the gd corresponding to php to solve this error. ######Here I use Ubuntu as an example to illustrate. If you install php7.0, you can use the following command to install it. ###
apt-get install php7.0
###At this time, you need to run the following command to install it. This problem can be solved ###
apt-get install php7.0-gd
###The following example also has the same solution############
apt-get install php7.0-mbstring
###If you install php7.2, change the version here. That’s it###
apt-get install php7.2-mbstring
###

The above is the detailed content of What should I do if composer gets an error when installing dependencies?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete