如何将〜/.composer/vendor/bin目录放置在PATH中? [英] How to place the ~/.composer/vendor/bin directory in your PATH?
问题描述
我正在Ubuntu 14.04上,并且我一直在尝试所有可能的方法来安装Laravel,但均无济于事.错误消息我尝试的一切.我现在正在尝试快速入门文档中的第一种方法,即通过Laravel Installer,但是它说请确保将~/.composer/vendor/bin
目录放在您的PATH
中,以便在您运行Laravel时找到Laravel可执行文件.在您的终端中命令."所以我的问题是,我该怎么做?这可能是一个简单的问题,但我真的很沮丧,不胜感激.
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.
推荐答案
将此文件夹放在PATH环境变量类型上
To put this folder on the PATH environment variable type
export PATH="$PATH:$HOME/.composer/vendor/bin"
这会将文件夹追加到您现有的PATH中,但是,它仅在您当前的终端会话中处于活动状态.
This appends the folder to your existing PATH, however, it is only active for your current terminal session.
如果要自动设置它,则取决于您使用的外壳.对于bash,您可以使用自己喜欢的编辑器将此行附加到$HOME/.bashrc
或在shell上键入以下内容
If you want it to be automatically set, it depends on the shell you are using. For bash, you can append this line to $HOME/.bashrc
using your favorite editor or type the following on the shell
echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
为了检查它是否有效,请注销并再次登录或执行
In order to check if it worked, logout and login again or execute
source ~/.bashrc
在外壳上.
PS:对于没有~/.bashrc
的其他系统,您也可以将其放入~/.bash_profile
PS: For other systems where there is no ~/.bashrc
, you can also put this into ~/.bash_profile
PSS:对于较新的幼虫,您需要将$HOME/.config/composer/vendor/bin
放在PATH
上.
PSS: For more recent laravel you need to put $HOME/.config/composer/vendor/bin
on the PATH
.
PSSS:如果要将此文件夹也放置在其他Shell或GUI的路径上,则应将上述export
命令附加到~/.profile
(请参见
PSSS: If you want to put this folder on the path also for other shells or on the GUI, you should append the said export
command to ~/.profile
(cf. https://help.ubuntu.com/community/EnvironmentVariables).
这篇关于如何将〜/.composer/vendor/bin目录放置在PATH中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!