install Composer in Ubuntu 16.04

教程 ali ⋅ 于 2017-04-25 15:12:20 ⋅ 983 阅读

Step 1:
Run

$ sudo apt-get update

If this was not done before.
Step 3:
Install wget for file download in ubuntu

$ sudo apt-get install wget

Step 2:
Download the composer.phar from https://getcomposer.org/download via wget or built-in curl

$ wget https://getcomposer.org/composer.phar

or

$ curl -O https://getcomposer.org/composer.phar

** -O is capital O not Zero(0)
Step 3:
Rename composer.phar to composer

$ mv composer.phar composer

Step 4:
Make composer executable

$ chmod +x composer

Step 5:
Now composer can be run locally through

$ ./composer

But this is available where you are i.e. current directory where the composer file is.
Step 6:
Make composer available globally move it to /user/local/bin by

$ sudo mv composer /usr/local/bin

Now composer will be available anywhere by simply

$ composer

Reference:
https://bappa.info/2016/05/07/install-composer-in-ubuntu-16-04/

回复数量: 0
    暂无评论~~
    • 请注意单词拼写,以及中英文排版,参考此页
    • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`, 更多语法请见这里 Markdown 语法
    • 支持表情,使用方法请见 Emoji 自动补全来咯,可用的 Emoji 请见 :metal: :point_right: Emoji 列表 :star: :sparkles:
    • 上传图片, 支持拖拽和剪切板黏贴上传, 格式限制 - jpg, png, gif
    • 发布框支持本地存储功能,会在内容变更时保存,「提交」按钮点击时清空
    Ctrl+Enter