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

藏色散人
Release: 2020-09-02 11:47:34
forward
4900 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login
###At this time, you need to run the following command to install it. This problem can be solved ###
apt-get install php7.0-gd
Copy after login
###The following example also has the same solution############
apt-get install php7.0-mbstring
Copy after login
###If you install php7.2, change the version here. That’s it###
apt-get install php7.2-mbstring
Copy after login
###

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!