Gautam Lal
Gautam Lal

Reputation: 11

Unable to create a project using laravel framework on ubuntu

Laravel (ubuntu): after installation of composer in the directory www/laravel i tried to create the project with the command (composer create-project laravel/laravel project1 --prefer-dist) but an error is popped

Error : No command 'composer' found, did you mean: Command 'compose' from package 'mime-support' (main) composer: command not found

Upvotes: 1

Views: 2596

Answers (2)

Tahir Yasin
Tahir Yasin

Reputation: 11699

Your composer is not accessible globally or not installed properly.

Use below command to install it globally so that you can run composer command everywhere.

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Notice the --filename=composer switch in the command it renames composer.phar to composer so that you can run $ composer instead of $ composer.phar

Complete guide about installing Laravel on Ubuntu can be found here: http://scriptbaker.com/install-laravel-on-ubuntu/

Upvotes: 1

Wouter J
Wouter J

Reputation: 41934

The recommended way to install composer is by installing it globally:

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

Now you can run:

$ composer

Another way is to install it locally, this is not recommended. That would mean only executing

$ curl -sS https://getcomposer.org/installer | php

Then, you should use:

$ ./composer.phar
# or
$ php composer.phar

Upvotes: 3

Related Questions