简体   繁体   中英

bash: laravel: command not found

I am Using my own Machine Kali Linux 2.0 Debian x64 . Now, i have Installed Laravel in my directory structure like /opt/lampp/htdocs/learning-larvel/

Inside the Learning-laravel folder i have Installed my Laravel files, and also i installed composer. So when i go to http://127.0.0.1/learning-laravel/public . I see a See a White Screen and in Between it is written "Laravel 5", which means the Laravel GUI Setup is fine.

Now, to create a new file for Laravel, when i open my Terminal and type laravel new xyz then it gives me a error which says bash: laravel: command not found

Now, how can i fix the error.. I have researched about it by setting PATH to bashrc. But i am not getting it fixed right. Additionally when i type in my command composer -version then also it says bash: composer: command not found but i have Installed composer on the folder learning-laravel itself. I could also see files like composer.phar there in /opt/lampp/htdocs/learning-larvel/

Any help would be extremely thankful.

As the composer official getting started page points out:

There are in short, two ways to install Composer. Locally as part of your project, or globally as a system wide executable.

if you wanna do composer -- or laravel -- in command line, you wanna install them globally.

Check out the following links:
https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx https://laravel.com/docs/4.2#install-laravel

I encountered the same problem. Apparently, the composer exists in path ~/.config/composer/vendor/bin when running as super user. Therefore, replacing the paths which were described above by this, and it should work. Hope it helps.

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