install composer on ubuntu14.04

1.download composer

$ sudo apt-get install curl
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

2.config composer use china mirror

1. METHOD1:change global config file (recommend)
$  composer config -g repo.packagist composer http://packagist.phpcomposer.com
2.METHOD2:change current project composer.json file
$  composer config repo.packagist composer http://packagist.phpcomposer.com
//you may add following contents to your composer.json file manually.
//"repositories": {
//    "packagist": {
//        "type": "composer",
//        "url": "http://packagist.phpcomposer.com"
//    }
//}

3.test(install laravel5.1)

$ composer create-project laravel/laravel laravel5.1 5.1

posted on 2016-02-02 01:56  yeah,youcandoit  阅读(212)  评论(0编辑  收藏  举报

导航