Home  >  Article  >  Development Tools  >  What is php composer?

What is php composer?

藏色散人
藏色散人Original
2019-05-17 17:40:285023browse

Composer is a dependency management tool that serves the PHP ecosystem; it can manage all dependencies required by PHP projects and help users automatically install the development packages they depend on for their projects. In other words, Composer will pull all the code libraries and dependencies required by the PHP project from the Internet and put them together for management.

What is php composer?

Composer is a dependency management tool for PHP5.3 and above. It allows you to declare the code libraries your project depends on and it will install them for you in your project. Composer is not a package manager. Yes, it involves "packages" and "libraries", but it's managed on a per-project basis, with installations in some directory within your project (e.g. vendor). By default it won't install anything globally. So this is just a dependency management.

Related recommendations: [composer tutorial]

You need to complete the following two steps to install Composer:

First: Download Composer to your project directory. Use the following command:

$ curl -s (Composer web site)/installer | php

This command only checks a small amount of PHP configuration, and then downloads the composer.phar file to your working directory. This file is the Composer executable file. It is a PHAR (PHP archive file, which can Contains any file and can be executed from the PHP command line).

Second: Install Composer to the specified directory, that is, add the --install-diroption parameter after the command line. Use the following command:

$ curl -s (Composer web site)/installer | php -- --install-dir=bin

The above is the detailed content of What is php composer?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn