2016-06-12 106 views
0

我有一个使用Ubuntu 14.4的Amazon EC2实例。在Ubuntu上全局安装Laravel/Lumen

我在全球安装了我的composer

当我安装流明我得到这样的结果 - 一切似乎很动听:

[email protected]:/var/www/html$ composer global require "laravel/lumen-installer" 
Changed current directory to /home/ubuntu/.config/composer 
Using version ^1.0 for laravel/lumen-installer 
./composer.json has been updated 
Loading composer repositories with package information 
Updating dependencies (including require-dev) 
    - Installing symfony/process (v3.1.0) 
    Loading from cache 

    - Installing symfony/polyfill-mbstring (v1.2.0) 
    Loading from cache 

    - Installing symfony/console (v3.1.0) 
    Loading from cache 

    - Installing guzzlehttp/promises (1.2.0) 
    Loading from cache 

    - Installing psr/http-message (1.0) 
    Loading from cache 

    - Installing guzzlehttp/psr7 (1.3.0) 
    Loading from cache 

    - Installing guzzlehttp/guzzle (6.2.0) 
    Loading from cache 

    - Installing laravel/lumen-installer (v1.0.2) 
    Loading from cache 

symfony/console suggests installing symfony/event-dispatcher() 
symfony/console suggests installing psr/log (For using the console logger) 
Writing lock file 
Generating autoload files 
[email protected]:/var/www/html$ 

但是当我键入lumenlumen new blog我收到lumen: command not found

基于其他问题,我想我必须流明simillarly添加到PATH这样:

export PATH="~/.composer/vendor/bin:$PATH" 

这并不有所作为 - 运行流明新的博客,仍然显示lumen: command not found

有没有人遇到这个错误?

+1

使用此代替以上导出PATH =“$ PATH:〜/ .composer/vendor/bin” – error2007s

+0

工作。非常感谢:) 你可以解释为什么这个工作?我试图学习Linux - 如果你添加它作为答案,我会接受答案 –

回答

2

您的问题不会简单地通过取消设置PATH来解决,因为您仍然没有包含必要系统目录的PATH。在设置自己的PATH时,在大多数情况下,您会希望将新条目追加到旧的PATH变量中,而不是像完成一样完全替换它。

使用此命令

export PATH="$PATH:~/.composer/vendor/bin" 

通知的变量设置为开始与现有的$ PATH。这样,你仍然可以在PATH中拥有所有的原始系统目录,并且你的添加将会结束。因为lumen显然是你要执行的二进制文件的名字,而你的PATH应该只包含包含二进制文件的目录,而不是二进制文件本身。