简体   繁体   中英

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

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM