Table of Contents
composer安装,composer
通过 Composer 镜像安装 composer
局部安装
全局安装
Home php教程 php手册 composer安装,composer

composer安装,composer

Jun 13, 2016 am 08:45 AM
Installation package

composer安装,composer

通过 Composer 镜像安装 composer

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

局部安装

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

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

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

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

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

全局安装

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

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

<code class="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>
Copy after login

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

<code class="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>
Copy after login

上述命令执行成功之后再将 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>
Copy after login
Statement of this Website
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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to extract the installation package of software installed on the computer How to extract the installation package of software installed on the computer Nov 30, 2023 pm 03:25 PM

Installed software on your computer can be extracted by using a third-party software extractor, extracting it directly from the system folder, or using a professional software packaging tool. Detailed introduction: 1. Use a third-party software extractor, select the installation directory of the installed software to be extracted, and set the save location of the extracted files. The software extractor will decompress and extract the related files of the installed software, and save the files to the specified location. location; 2. Extract directly from the system folder, etc.

Centos offline installation of Chinese version of GitLab Centos offline installation of Chinese version of GitLab Feb 19, 2024 am 11:36 AM

1. Download the gitlab installation package. Download the latest Chinese version of the gitlab installation package from [Tsinghua University Open Source Software Mirror Station]. The installation package comes with a simplified Chinese localization package. Download the latest gitlab installation package from [gitlab official website]. 2. Install gitlab, take gitlab-ce-14.9.4-ce.0.el7.x86_64 as an example, upload it to the centos server and use yum to install gitlabyum-yinstallgitlab-ce-14.3.2-ce.0.el7.x86_64. rpm uses yum to install gityum-yinstallgit#Install git and modify the gitlab configuration file vi

How to install and use pycharm in Linux environment? How to install and use pycharm in Linux environment? Mar 16, 2024 am 08:01 AM

To install and use PyCharm in a Linux environment, you can follow the steps below: Open a browser and visit the PyCharm official website (). Find the PyCharm version for Linux on the website and download the corresponding installation package. There are usually two versions to choose from: Community Edition (free version) and Professional Edition (paid version). Once the download is complete, open a terminal. In the terminal, navigate to the directory where you downloaded the installation package. Run the following command to decompress the installation package: tar-xvfpycharm-*.tar.gz Replace &quot;pycharm-*&quot; with the actual downloaded installation package file name

How to install deb installation package How to install deb installation package Feb 18, 2024 pm 12:02 PM

The deb installation package is one of the package management formats for DebianLinux systems and Debian-based distributions. With a .deb extension, use the dpkg tool for installation and management. The following will introduce the installation method of the deb installation package and provide specific code examples. 1. Install deb packages through apt-get. apt-get is a commonly used software package management tool in Debian and its derivatives. It can easily install software packages from various sources. Use apt-get to install the deb package

'Easy download of Golang installation package: Detailed guide, one-click completion' 'Easy download of Golang installation package: Detailed guide, one-click completion' Feb 25, 2024 pm 05:45 PM

A complete guide to downloading the Golang installation package. With the popularity of Golang, more and more developers are beginning to pay attention to and learn this language. However, for some beginners, downloading and configuring the Golang installation package may become a problem. Today, we will bring you a complete guide to downloading the Golang installation package, so that you can get the required installation package with one click without worrying, and provide specific code examples so that you can easily start your Golang journey. Step 1: Download the Golang installation package. First, I

What is the installation command for deb installation package? What is the installation command for deb installation package? Feb 22, 2024 pm 12:48 PM

Title: Deb installation package installation commands and specific code examples 1. What is a deb installation package? The deb installation package is a format used by the apt installer, the package management tool of the Debian operating system and its derivative distributions (such as Ubuntu). deb installation package is a binary software package that contains the program's executable file, configuration files, dependencies, etc. 2. Installation commands and code examples of deb installation packages. To install a .deb installation package, you need to use the apt or dpkg command. The following are these two

Can't open win11 installation package, what should I do? Can't open win11 installation package, what should I do? Dec 31, 2023 am 11:53 AM

When users try to upgrade their devices to the new Windows 11 operating system, they may encounter problems with the installation package being unable to start smoothly! Don’t worry, this article will explain to you in detail the methods and strategies to deal with this situation! What to do if win11 cannot be opened after downloading the installation package? Method 1: Check the network connection. If you find that the network connection is unstable, try to restart the router or try to change to another better network environment, and then try to install again. Method 2: Disable anti-virus software. In order to avoid potential interference factors, it is strongly recommended to suspend various anti-virus software on the computer before installation. After the installation is complete, restore it as needed. Method three: Run the installation program as an administrator. You can try to install the package by right-clicking and selecting

Golang download package guide: Get the latest version easily Golang download package guide: Get the latest version easily Feb 25, 2024 pm 12:48 PM

Golang is a simple, fast and efficient programming language that many developers prefer to use to develop various types of applications. However, before starting to use Golang, you need to make sure that you have successfully installed the corresponding Golang package. This article will provide you with a detailed guide to download the Golang installation package, help you quickly obtain the latest version, and provide specific code examples. Step 1: Download the Golang package. First, you need to visit the Golang official website (https://gol

See all articles