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.
当前回答
我尝试了很多解决方案,但在Ubuntu 20.04上只有这个对我有效:
export PATH="$HOME/.composer/vendor/bin:$PATH"
其他回答
对于Linux Mint 18:编辑~/。Bashrc并在底部添加这一行:
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
然后resource .bashrc(在控制台中输入):
source ~/.bashrc (or close and reopen the terminal)
通过在控制台中输入测试它:
echo $PATH
或者输入console:
laravel
我这样做了,它在osx上工作:
在终点站吃午餐
nano ~/.bash_profile
粘贴
export PATH=~/.composer/vendor/bin:$PATH
按control + x
按y键
按回车键
在Yosemite (OS X 10.10.5)上设置PATH,使用下面的命令:
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bash_profile
重新加载退出终端并重新启动或使用:
source ~/.bash_profile
帮助了我,希望它能帮助其他人!
如果有人使用ZSH,所有步骤都是一样的,除了几件事:
找到文件。zshrc 在底部添加以下一行export PATH=~/.composer/vendor/bin:$PATH 源~ / . zshrc
然后试试男仆,如果问密码,那么一切都ok。
针对Ubuntu 16.04
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
source ~/.bashrc