I'm on Ubuntu 14.04 and I've been trying all possible methods to install Laravel to no avail. Error messages everything I try. I'm now trying the first method in the quickstart documentation, that is, via Laravel Installer, but it says to "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the Laravel executable is found when you run the Laravel command in your terminal." so my question is, how do I do that? This may be a simple question but I'm really frustrated and would appreciate any help.
当前回答
在Fedora:
有些composer bin不在.composer目录中 所以你需要使用以下方法来定位它们:
locate composer | grep vendor/bin
然后在.bashrc中回显该部分
echo 'export PATH="$PATH:$HOME/{you_composer_vendor_path}"' >> ~/.bashrc
我的是"/.config/composer/vendor/bin" 干杯!
其他回答
在Ubuntu 16.04 LTS中,我在全球安装了作曲家,这对我来说很有效。
编辑您的主目录中的.bashrc文件,将其路径放到位于/your/home/.config/composer/vendor/bin的composer bin文件夹中
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
source ~/.bashrc
如果不行,请验证composer bin目录的路径,然后关闭并重新打开终端。否则,请尝试在Ubuntu中注销和登录。
也适用于ubuntu 18.04。感谢@chifliiiii的反馈。
我这样做了,它在osx上工作:
在终点站吃午餐
nano ~/.bash_profile
粘贴
export PATH=~/.composer/vendor/bin:$PATH
按control + x
按y键
按回车键
要解决这个问题,请确保您找到了作曲家的路径。phar第一
我的例子是这样的
alias composer="php /Users/Your-username/composer.phar"
进入cd Users >您的用户> Command ls,查看composer. sh是否存在。Phar在那里,如果是,然后将上面的行添加到.bash_profile。请确保将用户名更改为您自己的用户名。
希望这能帮到你
对我来说,在Ubuntu 22.04中,这是可行的:
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
我做了以上所有的事情,但它对我不起作用。
我只是把这个复制到我的终端,它为我工作。
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
推荐文章
- RVM不是一个函数,用' RVM use…’不会起作用
- 如何打破一个循环在Bash?
- 如何从终端机发送电子邮件?
- 操作系统。makdirs在我的路径上不理解“~”
- Linux Bash中双&和分号有什么区别?
- 在Bash中模拟do-while循环
- 在Ubuntu上安装Node.js
- 在Bash中将输出赋给变量
- 如何在Mac OS X 10.6中使硬件发出哔哔声
- Laravel雄辩的《WHERE NOT IN》
- 自动删除Laravel (Eloquent ORM)中的相关行
- 从Docker容器获取环境变量
- 从URI获取真实路径,Android奇巧新的存储访问框架
- 是否有可能' git状态'只修改文件?
- 如何重定向标准derr和标准输出到不同的文件在同一行脚本?