I tried to install composer via brew per:
In usr/local/bin
(which was not on Mavricks and I had to make personally) I did.
brew tap jose
You are in wrong directory. cd to your project directory then run composer update.
In my case, I did not copy all project files to the folder where I was running composer install
. So do:
composer.json
) to foldercomposer install
from thereIf you just want to make composer run, create a new composer.json
file with for example:
{
"require": {
"php": ">=5.3.2"
}
}
Then run composer install
.
You could try updating the composer:
sudo composer self-update
If that doest works remove composer files & then use: SSH into terminal & type :
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
If you face an error that says: PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
To install package use:
composer global require "package-name"
At first you should run:
php artisan key:generate
I encountered the same error, and was able to solve it as follows:
composer diagnose
to see if something is wrong with the version of composer installedcomposer self-update
to install the latest version composer update
to update your composer.json
file.