Yada Rahall
Yada Rahall

Reputation: 239

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.

Upvotes: 1

Views: 3190

Answers (2)

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.

Upvotes: 0

Hashbug
Hashbug

Reputation: 137

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

Upvotes: 2

Related Questions