I am trying to install composer on my Mac so that I can use the Laravel framework. I successfully downloaded composer through the terminal, and then I moved composer.phar to to usr/local/bin using the command: sudo mv composer.phar /usr/local/bin
.
I then changed directories to my root directory where I have the laravel-master files. After changing to this directory in the terminal, and then using the command: composer install
I receive the error: -bash: composer: command not found
I have tried other variations (such as php composer.phar install
, etc..), however, I keep receiving the same error.
Any help would be much appreciated. Thank you!
Via Download. Once Composer is installed, download the 4.2 version of the Laravel framework and extract its contents into a directory on your server. Next, in the root of your Laravel application, run the php composer. phar install (or composer install ) command to install all of the framework's dependencies.
Install Laravel Make sure to place the ~/. composer/vendor/bin directory in your PATH so the laravel executable is found when you run the laravel command in your terminal. Once installed, the simple laravel new command will create a fresh Laravel installation in the directory you specify.
When you are done installing the Composer, cross-check whether it is installed or not by typing in the command prompt the composer command. You can see the Composer screen in that CMD only.
In Laravel, the composer is a tool that includes all the dependencies and libraries. It helps the user to develop a project with respect to the mentioned framework. Third-party libraries can be installed easily using composer. Composer is used to managing its dependencies and the dependencies are noted in composer.
Make sure that /usr/local/bin
is in your $PATH
$ echo $PATH
Then execute
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
^^^^^^^^ you didn't rename it
For reference see
I'm running Mavericks and had same problem. I changed /usr/local/bin/composer
to /usr/bin/composer
and it worked for me.
for mac os x Mavericks and Yosemite El capitan
Change
sudo mv composer.phar /usr/local/bin/composer
To
sudo mv composer.phar /usr/bin/composer
Now if you just write composer
in terminal, it will show you all available commands
Then "if running MAMP" navagate you htdocs folder and run
composer create-project laravel/laravel laratest
Hope that helps
A quick copy-paste version including sudo:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With