Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RuntimeException vendor does not exist and could not be created

I've tried other posts I found online but none seemed to work correctly. I'm working with this. And I make my way to the root of it, which is /var/www/. So then I do composer install and I have a composer.json file in there. I get

[RuntimeException]                                vendor does not exist and could not be created. 

Here's the file

{     "name": "panique/php-login",     "type": "project",     "description": "A PHP login system embedded in a simple MVC framework",     "keywords": ["login", "auth", "user", "authentification", "mvc"],     "homepage": "https://github.com/panique/php-login",     "license": "MIT",     "authors": [         {             "name": "Panique",             "homepage": "http://careers.stackoverflow.com/panique",             "role": "Developer"         }     ],     "support": {         "issues": "https://github.com/panique/php-login/issues",         "source": "https://github.com/panique/php-login"     },     "require":{         "php": ">=5.3.7",         "ircmaxell/password-compat": "1.0.*",         "phpmailer/phpmailer": "5.2.*",         "gregwar/captcha": "dev-master",         "facebook/php-sdk": "@stable",         "raveren/kint": "dev-1.0.0-wip"     } } 

I'm not really sure where to go from here....

like image 843
user3413366 Avatar asked Mar 13 '14 20:03

user3413366


1 Answers

Googlers, do not use composer with sudo:

Add your user in the www-data group (this action require you to logout and login again)

sudo usermod -a -G www-data `whoami` 

Give the right permissions to /var/www

sudo chown root:root /var/www sudo chmod 755 /var/www/ 

Give these permissions to your project

sudo chown -R www-data:www-data /var/www/<project> sudo chmod -R 774 /var/www/<project> 
like image 112
Etienne Gautier Avatar answered Sep 22 '22 23:09

Etienne Gautier