Linux下composer安裝

國內網上的方法爲
curl -sS https://getcomposer.org/installer | phpphp

mv composer.phar /usr/local/bin/composer

若是上面方法可行,恭喜你,到此結束了!
/****************************************************/
搞了半天沒反映,只能換個方法了。

下面的命令注意你當前用戶在當前目錄的權限,中間文件最後條命令會刪除掉

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

到這裏php運行composer已經OK了,把它弄到全局去
 #mv composer.phar /usr/local/bin/composer

建立basic項目
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project yiisoft/yii2-app-basic ./basic 2.0.8 
composer create-project yiisoft/yii2-app-advanced ./index 2.0.9

(composer中國鏡像,貌似能夠快一點,
執行下面命令:
 composer config -g repo.packagist composer https://packagist.phpcomposer.com
 
yii2

相關文章
相關標籤/搜索