Drupal unable to create files on /var/www/html/drupal directory

by Nitish   Last Updated April 23, 2018 08:01 AM

I am trying to install drupal 7.18 in my Fedora 14 machine . I put the drupal filess in /var/www/html/drupal directory and set chmod 7777 -R drupal permission. But when I tried to install drupal it shows errors like :

File system The directory sites/default/files does not exist. An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the online handbook.

Settings file The settings file does not exist. The Drupal installer requires that you create a settings file as part of the installation process. Copy the ./sites/default/default.settings.php file to ./sites/default/settings.php. More details about installing Drupal are available in INSTALL.txt.

What is the issue there?? I am newbie to Linux.



Answers 2


First check that who is the owner of files. If it is user different with www-data you should change it to that user by doing:

$ cd /var/www && chown -R www-data:www-data html

This will take all files and change its owner and owner group to www-data.

That's maybe not intuitive, but during Drupal installation you should do some manual work. The error you receive clearly states what you should do.

First confirm that you have directory /var/www/html/drupal/sites/default/files. If doesn't exist you should create it by doing:

$ mkdir /var/www/html/drupal/sites/default/files

Secondly copy settings template to another file by doing:

$ cp /var/www/html/drupal/sites/default/default.settings.php /var/www/html/drupal/sites/default/settings.php 

This should be pretty much enough. If there will be any further error messages. Simply follow what they ask you to do...

AlexKey
AlexKey
January 14, 2013 09:12 AM

Single Drupal site setup:

To create the files folder:

cd /var/www/[website] [anyway it is the path to your web directory]

sudo mkdir sites/default/files && sudo chmod -R 777 files && sudo chown -R www-data:www-data files [or sudo chown -R apache:apache files] 

To create the settings.php

cd /var/www/[website] [anyway it is the path to your web directory]

sudo cp sites/default/default.settings.php sites/default/settings.php

sudo chmod -R 755 settings.php

Once you finished the installation, you need to do:

sudo chmod 644 settings.php 

or whatever you want to prevent write from other users.

Edmund518
Edmund518
April 23, 2018 07:38 AM

Related Questions


Setting default file permissions using setfacl

Updated November 01, 2017 00:01 AM