0

Its not the first time I install Drupal 8 on Ubuntu 15.10 (which I'm very new to) but it is indeed the first time when I can't install modules at it.

enter image description here

I ran the error at Google and After reading this document regarding to a similar problem in Drupal 7, and a few other docs, It seems I should do in terminal:

sudo chown -R www-data sites

Since I am new to Linux and I also know that Drupal 8's folder hierarchy has been changed a bit, and I'm not sure if its the right move (I'm afraid to make mess); Thus, I dedicate this question to senior developers which are also Linux veterans...

  • 1
    Yep, Drupal's folder hierarchy has changed. Modules are no longer kept in the sites folder. They're in the root directory of the Drupal install in a folder called "modules". I haven't had to change the owner of my modules directory to install modules, but I do it through Drush. Does the directory have write permissions? Try doing sudo chmod 755 modules – Chris Jan 3 '16 at 21:23
  • Tried that + restarting the server - Didn't work :\ The module folder permissions are 755 and it's owner is benwork (my user). You might have any other advice for me? – user16289 Jan 3 '16 at 21:41
  • 1
    The owner needs to be the web server user (www-data). It's the web server that's trying to write – Clive Jan 3 '16 at 22:34
2

go to the folder where you installed Drupal 8. Ex:

cd /var/www/drupal

In you case, it looks like it's:

cd /var/www/html/benia

then

sudo chown www-data -R modules

Now try installing again.

To prevent other conflict, I would www-data all of your Drupal

cd /var/www/html/

sudo chown www-data -R benia
| improve this answer | |
  • This advice is only for developing sites. See answer from Eyal. Don't do this in production. When all php files are owned by www-data, they are not protected against manipulation when there is a security issue. – 4k4 Jan 5 '16 at 13:07
1

If you are running the site on a developer machine then changing the owner (and permissions) is not that harmful (as your IP is not public knowledge).

However if this is your production (/staging/QA/whatever) server you should keep the permissions as they were.

Sugestion:

Download contributed modules and themes via Drush, Drupal console or GIT.
With command line you can always sudo the permissions away :)

| improve this answer | |
0

I would prefer you to use Drush and Composer to install modules. They minimize your chances of messing up. To download Composer go to getcomposer.org To download drush type:

composer global install drush/drush

Navigate to your Drupal 8 installation's modules folder by typing:

cd /var/www/html/benia/modules

then

drush dl module_name

Navigate into the module's directory

cd module_name

Install dependencies of the module by typing:

composer install

Finally enable the module by typing:

drush en module_name

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy