Wednesday, March 1, 2017

Frustration Installing Laravel on Ubuntu

Now I remember why I never got into PHP. It's such a pain to set up. I spent a couple hours today trying to complete a coding challenge which required me to install Composer, Vagrant, VirtualBox and Laravel.

Somewhere along the line I think my permissions or something changed, because whenever I try to install Laravel...

composer global require "laravel/installer"

I get...

Changed current directory to /home/dilraj/.composer

  [ErrorException]                                                             
  file_put_contents(./composer.json): failed to open stream: Permission denied                                                                            


require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

I am not sure why I am getting this, perhaps it is because I have already done it, but regardless, when I try to create an executable command I am not seeing any results.

I edited the .bashrc file, as such...

export PATH="$PATH:$HOME/.config/composer/vendor/bin

source ~/.bashrc

I am not going to lie, I don't what this is even doing. I just want to make it so I can type 'laravel' and then start doing stuff, kinda like in npm.

Here are other things I tried but succeeded without any luck :(

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

export PATH="$PATH:$HOME/.config/composer/vendor/bin"

alias laravel='~/.config/composer/vendor/bin/laravel'




via dsomel21

Advertisement