1

I was trying to install laravel on a mac using a composer as mentioned on the laravel.com installation page.

I set the path to the ~/.composer/vendor/bin and tried to execute laravel command. the following error keeps

-bash: laravel: command not found

Also tried to add the path to the ~/.bashrc file, but that didn't help!

Can someone please help me resolve this?

vthallam
  • 551
  • 2
  • 8
  • 20
  • What do you expect from running ``laravel`` in terminal? :) Laravel is the PHP framework, not cli command. – Limon Monte Mar 29 '15 at 17:39
  • I know its a framework! laravel installation provides an environment to create projects using laravel from cli and thats not working in my case! – vthallam Mar 29 '15 at 17:56
  • didn't know that, thanks! Maybe you can find answer here: http://stackoverflow.com/questions/26376516/laravel-php-command-not-found – Limon Monte Mar 29 '15 at 18:19
  • You need to add the PATH in `~/.bash_profile` not `~/.bashrc` – mininoz Mar 29 '15 at 18:43

2 Answers2

1

There's three possibilities here

  1. You're not actually adding the path to your $PATH

  2. You're adding the path to your $PATH but the laravel CLI isn't installed

  3. You're adding the wrong path to your $PATH

All of which every new unix shell users has stumbled with before, so don't feel bad!

First, I'd make sure the laravel CLI is installed by trying to run it with the following

$ ~/.composer/vendor/bin/laravel

Assuming the above doesn't result in an error message, it means the command is installed.

Assuming you have the command installed, this means whatever you're doing to add the path to your $PATH isn't working. Try echoing out the path in your shell

$ echo $PATH

I bet you don't see ~/.composer/vendor/bin/laravel in there. If that's the case, update your question with information on what you're doing when you "set the path to the ~/.composer/vendor/bin" or "add the path to the ~/.bashrc file,". Chances are you're doing something wrong there.

Also, if you could include the output from echo $PATH that'd be useful for people who want to help you track this down.

Alana Storm
  • 164,128
  • 91
  • 395
  • 599
0

I know this is an old enough thread but I was looking for the solution and in my case it's that ~/.composer/vendor/bin isn't liked at all in the path so I've to give the full actual path /Users/myusername/.composer/vendor/bin and then things work

I can run ~/.composer/vendor/bin/laravel from the terminal but appending it to PATH isn't liked at all. I've probably done something weird at some stage

(Anyways just wasted 20 minutes of my life)

Forbairt
  • 11
  • 4