Thursday, April 30, 2015

Drupal install and permissions



So I'm really stuck on this issue. An install process is complaining about write permission on settings.php and sites/default/files/. However, I've moved these files temporarily to write/read (chmod 777) and changed the owner/group to "apache" as shown below.



-bash-4.1$ ls -hal
total 28K
drwxrwxrwx. 3 richard richard 4.0K Aug 23 15:03 .
drwxr-xr-x. 4 richard richard 4.0K Aug 18 14:20 ..

-rwxrwxrwx. 1 apache apache 9.3K Mar 23 16:34 default.settings.php
drwxrwxrwx. 2 apache apache 4.0K Aug 23 15:03 files
-rwxrwxrwx. 1 apache apache 0 Aug 23 15:03 settings.php


However, the install is still complaining about write permissions. I followed steps one and two of the INSTALL.txt but no luck.



Update:



To further explore the situation, I created sites/default/richard.php with the following code:




error_reporting(E_ALL);
ini_set('display_errors', '1');
mkdir('files');
print("
User is ");
passthru("whoami");
passthru("pwd");
?>



Run from the command line (under user "richard"), no problem. The folder is created everything is a go. Run from the web, I get the following:




Warning: mkdir(): Permission denied in
/var/www/html/sites/default/richard.php
on line 9 User is apache
/var/www/html/sites/default





Update 2:



Safe mode appears to be off...



-bash-4.1$ cat /etc/php.ini | grep safe | grep mode | grep -v \;
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_

safe_mode_protected_env_vars = LD_LIBRARY_PATH
sql.safe_mode = Off

Answer



There are couple of things to consider




  1. Turn selinux off or set it to permissive mode


  2. Check the selinux context of read/write permission directory


  3. Clear the cache of your browser and try again.



  4. restart apache and try again.


  5. Check if the directory has any disk quota and it exceeded the limit.



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...