Home >Backend Development >PHP Tutorial >composer installation, composer_PHP tutorial

composer installation, composer_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:58:50791browse

composer installation, composer

Install composer

through Composer mirror

Make sure you have PHP installed correctly.

Partial installation

Partial installation is to install composer to the current directory (such as installing it to the project root directory), and then you can use composer through php composer.phar.

Mac or Linux system: Open a command line window and execute the following command:

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

Windows system (Mac or Linux system can also be used): Please execute the following command:

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

Global installation

Global installation is to install composer to the path contained in the system environment variable PATH, and then you can directly execute the composer command in the command line window.

Mac or Linux system: Open a command line window and execute the following command:

<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 system: Please execute the following command in the command line:

<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>

After the above command is successfully executed, add the C:bin path to the PATH environment variable. Finally, reopen a command line window and try executing composer --version to see if the version number is correctly output, for example:.

<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>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1101077.htmlTechArticlecomposer installation, composer Install composer through the Composer image. Make sure that PHP has been installed correctly. Partial installation Partial installation is to install composer under the current directory (for example...
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