PHP's dependency management tool composer Introduction and use

Source: Internet
Author: User

Official documents:
Http://docs.phpcomposer.com/00-intro.html#System-Requirements

Install on Linx:
Download the Composer executable file

Partial installation
To really get Composer, we need to do two things. First install Composer (again, which means it will be downloaded to your project):

Curl-ss Https://getcomposer.org/installer | Php
Note: If the above method fails for some reason, you can also download the installer via PHP >:

Php-r "ReadFile (' Https://getcomposer.org/installer ');" | Php
This will check some PHP settings and then download Composer.phar to your working directory. This is a binary file of Composer. This is a PHAR package (PHP archive), which is a PHP archive format that helps users perform some operations on the command line.

You can specify the installation directory for Composer by using the--install-dir option (it can be an absolute or relative path):

Curl-ss Https://getcomposer.org/installer | PHP----install-dir=bin

Global Installation
You can put this file anywhere. If you put it in the PATH directory of the system, you will be able to access it globally. In Unix-like systems, you can even use PHP without a prefix.

You can execute these commands to let composer make a global call on your system:

Curl-ss Https://getcomposer.org/installer | Php
MV Composer.phar/usr/local/bin/composer
Note: If the appeal command fails because of permission execution, use sudo again to try running the MV command.

Now just run the composer command to use composer without the need to enter PHP Composer.phar.

Global installation (on OSX via homebrew)
Composer is part of the homebrew-php project.

Brew Update
Brew Tap josegonzalez/homebrew-php
Brew Tap Homebrew/versions
Brew Install Php55-intl
Brew Install Josegonzalez/php/composer

PHP's dependency management tool composer Introduction and use

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.