From 199a6b60837beb35ae0c862718cce3e45f375bbb Mon Sep 17 00:00:00 2001 From: Alina Mackenzie Date: Sun, 30 Aug 2015 15:59:39 -0500 Subject: [PATCH] Clarify local vs. global Composer installation Since global installion is assumed in later sections, show commands for global installation of Composer. Include note about using `sudo`, if needed. --- _posts/04-02-01-Composer-and-Packagist.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/_posts/04-02-01-Composer-and-Packagist.md b/_posts/04-02-01-Composer-and-Packagist.md index f1f2e4f..14bb2b2 100644 --- a/_posts/04-02-01-Composer-and-Packagist.md +++ b/_posts/04-02-01-Composer-and-Packagist.md @@ -14,13 +14,16 @@ There are already a lot of PHP libraries that are compatible with Composer, read ### How to Install Composer -You can install Composer locally (in your current working directory; though this is no longer recommended) or globally -(e.g. /usr/local/bin). Let's assume you want to install Composer locally. From your project's root directory: +You can install Composer locally (in your current working directory) or globally (e.g. /usr/local/bin, recommended). +Let's assume you want to install Composer globally: {% highlight console %} -curl -s https://getcomposer.org/installer | php +curl -sS https://getcomposer.org/installer | php +mv composer.phar /usr/local/bin/composer {% endhighlight %} +Note: If the above fails due to permissions, run the `mv` line again with `sudo`. + This will download `composer.phar` (a PHP binary archive). You can run this with `php` to manage your project dependencies. Please Note: If you pipe downloaded code directly into an interpreter, please read the