Composer: PHP package manager

To use composer, first system must satisfy php environment:

php --version

To install composer, try either:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

yum install composer

enable packagist repo globally: [its speed seems not fast, but should better than github], global config files are located at ~/.config/composer/

composer config -g repo.packagist composer https://packagist.phpcomposer.com

locally, should have a composer.json first locally:

composer config repo.packagist composer https://packagist.phpcomposer.com

after that, writing the composer.json:

{
    "require": {
        "laravel/framework": "5.0.*",
        "mews/captcha": "~2.0"
    },
    "minimum-stability": "dev"
}

and then install files locally with composer.json:

composer install

 

some packages needs php7, so in centos we use sclo to install rh-php70, and some packages may also needs extensions like mbstring in php7 version, install them both by searching:

yum list rh-php70* |grep mbstring

 

posted on 2017-11-24 11:31  三叁  阅读(425)  评论(0编辑  收藏  举报

导航