Ubuntu 16.04 Install composer

Source: Internet
Author: User
Tags composer install

1, download composer:

Curl-ss Https://getcomposer.org/installer | Php


2, installation composer:

/usr/bin/php Composer.phar--version


3. Set global command

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


4. View version:

Composer-version


5, composer will prompt you a lot of orders

6. The init command can Configuration Package name, Description, Author, Minimum, Package Type, License, dependencies, and dev dependencies information.

Composer Init

After you complete this information, create your own package

7, oh yes, you can search

Composer Search Package

8, can show

Composer Show-all Bag

9, use the install need to configure the JSON file first.

We first add a Monolog/monolog dependency library to the Composer.json configuration, as follows:

{
    "name": "Test/test", "
    description": "Test init",
    "type": "Library",
    "license": "License Description ",
    " authors ": [
        {
            " name ":" Mayanlong ",
            " email ":" json_vip@163.com "
        }
    ],
    "Require": {
        "Monolog/monolog": "1.21.*",
    }
}

Then install dependencies by using the following command

$ composer Install
10, update (updated)

If we add or remove a dependency, we can update it with the following command

$ composer Update   

11. Require (affirm Reliance)

We can also add dependencies directly to the command, which is automatically downloaded when the command is executed, as follows:

$ composer require symfony/http-foundation


12, in fact, I mainly want to engage in that phpsipder, did not expect to get a pass this ...













Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.