Igor L.
Igor L.

Reputation: 3445

Globally installing Laravel/Lumen on Ubuntu

I have an Amazon EC2 instance with Ubuntu 14.4.

I installed my composer globally.

When I install Lumen I get this result - everything seems fine:

ubuntu@ip-XXX-XX-XX-XX:/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
ubuntu@ip-XXX-XX-XX-XX:/var/www/html$

But when I type lumen or lumen new blog I receive a lumen: command not found.

Based on other questions, I assume I have to add lumen to the PATH simillarly to this:

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

This does not make a difference - lumen: command not found is still displayed after running lumen new blog.

Did anyone run into this error?

Upvotes: 0

Views: 3803

Answers (1)

Piyush Patil
Piyush Patil

Reputation: 14523

Your problem will not be solved simply by unsetting PATH, as you'll still be left without a PATH that includes the necessary system directories. When you set your own PATH, in most cases you will want to append your new entry to the old PATH variable, not replace it entirely, as you have done.

Use this command

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

Notice the variable is set to begin with the existing $PATH. This way, you'll still have all the original system directories in your PATH, and your addition will be on the end. Because lumen is apparently the name of the binary you are trying to execute, and your PATH should include only directories containing binaries, not the binaries themselves.

Upvotes: 3

Related Questions