1

I've read several threads here talking about this issue and tried all the solutions provided, none of them are working.

Whenever I try composer install I get a bunch of errors saying cannot install

[RuntimeException]                                                 
  /var/www/html/app/vendor does not exist and could not be created. 

Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
  - Installing vlucas/phpdotenv (v2.2.0)
    Downloading: Failed       
    Downloading: Failed       
    Downloading: Failed       
    Failed to download vlucas/phpdotenv from dist: The "https://api.github.com/repos/vlucas/phpdotenv/zipball/9caf304153dc2288e4970caec6f1f3b3bc205412" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
    Now trying to download from source

This is what I've tried so far:

sudo chmod -R g+rwX /var/www/html
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rwX /var/www
sudo chgrp www-data /var/www/html
sudo chmod 775 /var/www/html
sudo chmod g+s /var/www/html
sudo useradd -G www-data george
useradd: user 'george' already exists
sudo chown george /var/www/html/
sudo chown george /var/www/html/app/
sudo chmod g+s /var/www/html/app
sudo chmod 775 /var/www/html/app
You'reAGitForNotUsingGit
  • 14,669
  • 9
  • 48
  • 83
Halnex
  • 133
  • 2
  • 5
  • 1
    add george to the www-data group. `sudo usermod george -g www-data` –  Jun 03 '16 at 16:00
  • @bc2946088 still getting the same error `Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.` and `The authenticity of host 'github.com (192.30.252.130)' can't be established.` – Halnex Jun 03 '16 at 16:07
  • Are you behind a proxy ? – storm Jun 03 '16 at 16:47
  • @AhmedJerbi I'm on a VM. I think it worked after I reinstalled the ca-certificates – Halnex Jun 03 '16 at 18:28
  • @Halnex Reboot after adding a user to a group for the change to take effect – Underverse Apr 09 '19 at 14:04

2 Answers2

0

Just run the following command: sudo chown -R $(whoami) /var/www/html

cocomac
  • 3,043
  • 3
  • 16
  • 49
0

You can change ownership of the html directory like this:

sudo chown pi /var/www/html

Then set permissions to

chmod 776 -R /var/www/html

Which will allow read, write and execute permissions for User and Group and giving read and write permission to Other (www-data,apache, etc ...).

pa4080
  • 29,351
  • 10
  • 85
  • 161
SDsolar
  • 3,089
  • 9
  • 27
  • 48
  • 1
    you have a typo, www.html ? – Shoyeb Sheikh Apr 09 '19 at 07:03
  • More information on what permissions should be set for `/var/www` in this post (https://askubuntu.com/a/493401/819809). – jackw11111 Apr 09 '19 at 09:59
  • 3
    You should never change permissions or ownership of /var/www/html (or any other system directory). Instead add your user(s) to the correct groups, or use `sudo` when you need to access those directories. By keeping the access rights as restricted as possible you will the best security on your system. – Soren A Apr 09 '19 at 13:11