This question already has an answer here:
When I try to install laravel 5 in ubuntu, I am getting error like this,
laravel: command not found
I followed these steps,
composer global require "laravel/installer=~1.1"
laravel new blog
This question already has an answer here:
When I try to install laravel 5 in ubuntu, I am getting error like this,
laravel: command not found
I followed these steps,
composer global require "laravel/installer=~1.1"
laravel new blog
I found the solution after i tried many many times. First, check your actual path to the laravel installer. You need to go to
/home/(here is your name)/.config/composer/vendor/bin
... to check if it really exist that path. In the beginning i got the 'laravel command not found' and 'bash: /home/eduard/.composer/vendor/bin/laravel: No such file or directory', so i checked if the path was correct, and it really wasn't, my path was/home/eduard/.config/composer/vendor/bin
, i was different from any paths i found on internet. Aftercomposer global require "laravel/installer=~1.1"
, the solution is:/bin
. So, go to/home/(here you put your name)/.config/composer/vendor/bin
(this is my path), and remember the path.cd ~
, and thensudo nano .bashrc
scroll down to the ending of the file and add:
export PATH="$PATH:~/.config/composer/vendor/bin" alias laravel='~/.config/composer/vendor/bin/laravel'
(!! important: keep in mind that your path may be a little bit different, make sure that the path exist like in step 1, if it's a little bit different then change it as it's your).source ~/.bashrc
laravel
in terminal to see if everything is ok.Keep in mind that your path may be different from any on the web, make sure that your the path it's correct, check it, and put the right one as I did. I'm using Ubuntu 16, but the solution I think is similar for any version, as long as you put your correct path.
If for some reasons previous Answer doesn't work, like in my situation, try this (as a root or with sudo):
and then put to the end of the file this:
Source
P.S. btw I am using
I followed this process installing Laravel 5 on my Linux Mint(Ubuntu-based distro): (I have written full steps to help anyone who needed simple steps.)
Install composer
check if the composer is working by typing
once the composer is installed, install laravel/installer via composer using the following command
after installing export the path
Open terminal and run these commands:
For zsh and bash:
For bash only:
After searching in internet I was found for Ubuntu 17.04, 17.10 and 18.04 this code that work's fine:
This saved my day!