简体   繁体   English

bash:laravel:命令未找到

[英]bash: laravel: command not found

I am Using my own Machine Kali Linux 2.0 Debian x64 . 我正在使用自己的计算机Kali Linux 2.0 Debian x64。 Now, i have Installed Laravel in my directory structure like /opt/lampp/htdocs/learning-larvel/ 现在,我已经在/opt/lampp/htdocs/learning-larvel/等目录结构中安装了Laravel

Inside the Learning-laravel folder i have Installed my Laravel files, and also i installed composer. 在Learning-laravel文件夹中,我已经安装了Laravel文件,还安装了作曲器。 So when i go to http://127.0.0.1/learning-laravel/public . 因此,当我转到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. 我看到一个“看到白色屏幕”,并且在两者之间写有“ Laravel 5”,这表示Laravel GUI设置很好。

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 现在,为Laravel创建一个新文件,当我打开终端并输入laravel new xyz它给我一个错误,提示bash: laravel: command not found

Now, how can i fix the error.. I have researched about it by setting PATH to bashrc. 现在,我该如何解决该错误。我已经通过将PATH设置为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. 另外,当我输入命令composer -version它还会显示bash: composer: command not found但是我已经在文件夹learning-laravel本身上安装了composer。 I could also see files like composer.phar there in /opt/lampp/htdocs/learning-larvel/ 我还可以在/opt/lampp/htdocs/learning-larvel/看到像composer.phar这样的文件

Any help would be extremely thankful. 任何帮助将非常感激。

As the composer official getting started page points out: 作曲家官方入门页面指​​出:

There are in short, two ways to install Composer. 简而言之,有两种安装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. 如果您想在命令行中执行composer --laravel --在全局安装它们。

Check out the following links: 查看以下链接:
https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx https://laravel.com/docs/4.2#install-laravel 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. 显然,以超级用户身份运行时,撰写器位于〜/ .config / composer / vendor / bin路径中。 Therefore, replacing the paths which were described above by this, and it should work. 因此,以此替换上面描述的路径,它应该起作用。 Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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