ShittyAdvice
ShittyAdvice

Reputation: 265

Laravel command not found

So I installed laravel on my server. Now I added the path using:

sudo PATH=$PATH:~/.composer/vendor/bin

Now laravel command works fine for root/sudo users but not for normal users. I want normal users to be able to use the command as well. Currently it's not found at all(as a normal user)

laravel: command not found

Is there a way to give all users access(or users with the group laravel for example)

I'm running UBUNTU 14.04

Upvotes: 2

Views: 4016

Answers (3)

Kanak_
Kanak_

Reputation: 1

Try to get a Laravel Development Environment through pre-installed composer:

Type the following command on your command shell:

composer global require "laravel/installer=~1.1"

Then on typing 'which composer' can get you the path: On my system it is :

C:\Users\user\AppData\Roaming\Composer\vendor\bin

After getting the path,copy the path and cd into it through your command shell: Then type:

laravel new project

A new laravel development environment will be set up. You can see a new folder created once you visit that path.

Upvotes: 0

Jacob Budin
Jacob Budin

Reputation: 10003

You want to symbolically link the executable into the system user's default $PATH. The most appropriate place to link it is in /usr/local/bin. You can create the link like so:

$ sudo ln -s /full/path/.composer/vendor/bin/laravel /usr/local/bin/laravel

Note: This will not allow users to execute laravel if they do not have sufficient privileges to do so.

Upvotes: 3

Odifek
Odifek

Reputation: 26

To add path, you don't need to use sudo. Just do it as normal user, ~$PATH=$PATH:~/.... or just edit ~.profile and add it to make it permanent so that when you login again, you won't need to repeat

Upvotes: 1

Related Questions