search
Homephp教程php手册composer安装,composer

composer安装,composer

通过 Composer 镜像安装 composer

务必确保已经正确安装了PHP

局部安装

局部安装是将 composer 安装到当前目录下面(比如安装到项目根目录下),然后就可以通过 php composer.phar 来使用 composer 了。

Mac 或 Linux 系统:打开命令行窗口并执行如下命令:

<code class="language-bash hljs">curl <span class="hljs-operator">-sS http://install.phpcomposer.com/installer | php
</span></code>

Windows 系统(Mac 或 Linux 系统也可以使用):请执行如下命令:

<code class="language-bash hljs">php -r <span class="hljs-string">"readfile('http://install.phpcomposer.com/installer');" | php</span></code><br /><br />

全局安装

全局安装是将 composer 安装到系统环境变量 PATH 所包含的路径下面,然后就能够在命令行窗口中直接执行 composer 命令了。

Mac 或 Linux 系统:打开命令行窗口并执行如下命令:

<code class="language-bash hljs">curl <span class="hljs-operator">-sS http://install.phpcomposer.com/installer | sudo php -- --install-dir=/usr/<span class="hljs-built_in">local/bin --filename=composer
</span></span></code>

Windows 系统:请在命令行中执行如下命令:

<code class="language-bash hljs">mkdir C:\bin
<span class="hljs-built_in">cd C:\bin
php -r <span class="hljs-string">"readfile('http://install.phpcomposer.com/installer');" | php
<span class="hljs-built_in">echo @php <span class="hljs-string">"%~dp0composer.phar" %*>composer.bat
</span></span></span></span></code>

上述命令执行成功之后再将 C:\bin 路径加入 PATH 环境变量即可。最后重新打开一个命令行窗口试一试执行 composer --version 看看是否正确输出版本号,例如:。

<code class="hljs css"><span class="hljs-tag">Composer <span class="hljs-tag">version 1<span class="hljs-class">.0-dev (72<span class="hljs-tag">cd6afdfce16f36a9fd786bc1b2f32b851e764f) 2015<span class="hljs-tag">-12-28 17<span class="hljs-pseudo">:35<span class="hljs-pseudo">:19</span></span></span></span></span></span></span></code>
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.