Home  >  Article  >  Backend Development  >  composer installation (China mirror)

composer installation (China mirror)

WBOY
WBOYOriginal
2016-07-30 13:29:561022browse

Reprint address: http://my.oschina.net/igq/blog/312322

1. Install composer. There are many installation tutorials on the Internet. Here is the global installation

$ curl -sS https://getcomposer.org/installer | php $ mv composer.phar /usr/local/bin/composer2. Modify the configuration and use the Chinese mirror First find the config file$ sudo composer config -l -g

composer installation (China mirror)

Modify the configuration file

$ sudo vim /root/.composer/config.jsonAdd the mirror address{ "repositories": [ {"type": "composer", "url": "http://pkg.phpcomposer.com/repo/packagist/"}, {"packagist": false} ] }

Complete modification, save and exit

composer installation (China mirror)

3. Update composer

$ composer self-update

Add this place:

Possibly This problem will occur:


This is due to insufficient permissions. Just one sudo in front of you is enough. Or change the permissions of .composer/.

The above introduces the composer installation (Chinese mirror), including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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