1. i installed drupal 5.7 on ubuntu 8.04 (hardy heron) dekstop and i get this " The directory files is not writable" . i follow the server set up from http://www.lullabot.com/videocast/install-local-web-server-ubuntu and i did change the ownership to myself from root. but nothing changes..
2. before i try drupal 5.7 i work on drupal 6.2 and get this

* The Drupal installer requires write permissions to ./sites/default during the installation process. If you are unsure how to grant file permissions, please consult the on-line handbook.
* 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, please see INSTALL.txt or the on-line handbook.

and i change the default.settings.php to settings.php and i change the permission and i get this

* Failed to connect to your MySQL database server. MySQL reports the following message: Access denied for user 'username'@'localhost' (using password: YES).
o Are you sure you have the correct username and password?
o Are you sure that you have typed the correct database hostname?
o Are you sure that the database server is running?
For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.
* 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, please see INSTALL.txt or the on-line handbook.

Please help me out..

Comments

VM’s picture

drupal require persmissions on the files folder to be 777

that said: the problem you are having with the settings.php file is you should have left it be default.settings.php with 777 permissions so the installer can write to the file during installation of Drupal. where it will add the necessary information to teh $db_url string

Shally87’s picture

Thanks Verymisunderstood.. i try it by having both default.setting.php and setting.php...same thing still occur.. i not sure what the problem really is but i think folder permission because i cannot write on the folder..
* after installation drupal 5.7 i change back the permission to normal as what it wanted on the interface..
*installation of drupal 6.2 did not detect the default.setting.php i think..
Please lend a helping hand..
thanks..

Shally87’s picture

i tried the 777..
chmod 777 "my directory"
thanks a lot veryMisunderstood..

mauror’s picture

If you chmod 777, obviously it always work, but actually you don't need to make that directory writable by everybody, making it (and everything under it) writable by the apache process is enough...
On my local servers I do like this:

  • I chown all of my drupal tree to something like root.apache, (user=root, group=apache),
    $ chown -R root.apache ./drupal
  • Then I chmod 755 (rwxr-xr-xr-x) all of the dirs, and 644 (rw-r--r--) all of the files,
    $ find . -type d -print0 | xargs -0r chmod 755
    $ find . -type f -print0 | xargs -0r chmod 644
  • Then
    $ chmod 775 files

So I get something like this:

$ ls -lasF
...
4 -rw-r--r--  1 root   apache   262 2006-08-09 09:42 cron.php
4 drwxr-xr-x  2 apache apache  4096 2007-07-31 07:57 files/
4 -rw-r--r--  1 root   apache  3694 2007-05-21 03:34 .htaccess
4 drwxr-xr-x  3 root   apache  4096 2007-08-27 17:19 includes/
4 -rw-r--r--  1 root   apache   872 2006-12-12 10:32 index.php
4 -rw-r--r--  1 root   apache  1431 2006-09-08 18:29 INSTALL.mysql.txt
...
$ ls -lasF files
4 drwxrwxr-x  3 apache apache 4096 2007-06-23 16:12 ./
4 drwxr-xr-x 11 root   apache 4096 2007-10-02 14:23 ../
4 drwxr-xr-x  3 apache apache 4096 2007-06-23 16:12 color/
4 -rw-rw-r--  1 apache apache   93 2007-05-11 18:30 .htaccess

This way your drupal code cannot be modified by apache (it shouldn't), but apache can create/delete/write files and directories under files/.

ltwinner’s picture

Can someone explain to me what is happening in this line?
$ find . -type d -print0 | xargs -0r chmod 755

mauror’s picture

It means: find, starting from the current directory (".") everything that is a directory, then send (with a pipeline ("|")) the list of everything found, NULL separated, to the xargs command that executes the command 'chmod 755 ' for every found...

It's in the man pages for find(1) and xargs(1)...

moltra’s picture

@mauror great idea. Thanks

david2hass’s picture

Thank you for your help :) I can use :)

bluebabe’s picture

I found the same problem discribed above.
I fixed it by disableing selinux.

vi etc/sysconfic/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
<strong>SELINUX=disabled</strong>
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
rowly’s picture

run these commands:

chcon -R -t httpd_sys_content_rw_t /var/www/html/sites/default/files/
chcon -R -t httpd_sys_content_rw_t /var/www/www.example.com/private-files

enable send mail:
setsebool -P httpd_can_sendmail on