Bxx
Bxx

Reputation: 1625

Laravel Installation/Configuration - Command Not Found

Trying to install Laravel on Ubuntu Server 14.04. After installing PHP 7 I enter:

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

I get: Composer successfully installed to: /home/ubuntu/composer.phar

sudo mv composer.phar /usr/local/bin/composer
composer

Works fine

composer global require "laravel/installer"

I get:

enter image description here

nano ~/.bashrc

I include this export PATH="~/.composer/vendor/bin:$PATH" at the very bottom.

sudo service apache2 restart

Restart it

laravel

I get: "laravel: command not found"

Why does it not understand the command laravel?

Upvotes: 2

Views: 2887

Answers (2)

Luka Govedič
Luka Govedič

Reputation: 656

I'm writing this answer for all the future Google searchers. I had a similar issue and I solved it in the following way:

First run:

sudo apt-get install zip unzip php7.0-zip

Then, edit your ~/.bashrc file and append the following line:

export PATH="$PATH:$HOME/.composer/vendor/bin"

or

export PATH="$PATH:$HOME/.config/composer/vendor/bin"

Which one is yours, depends on the line composer printed out during installation of laravel, followed by /vendor/bin. In my case (and in the case of the question), this was $HOME/.config/composer, so I had to do it the second way: enter image description here

Don't forget to call

source ~/.bashrc

at the end. Enjoy Laravel!

Upvotes: 3

From your screenshot, I can see that there may be a chance the laravel packages were not installed correctly as you don't have zip and unzip installed on your system.

Run the following command to install these first and then try again to install laravel installer:

sudo apt-get install zip unzip

Regarding the export PATH use $HOME instead of the tilde ~ sign. Hope this will solve your problem. Seems like a path error.

export PATH="$PATH:$HOME/.composer/vendor/bin"

Upvotes: 1

Related Questions