我正在尝试在我的 Linux(Fedora 17)机器上安装 drupal 7。我已向chmod -R 755
目录授予权限/var/www/html/drupal
,此外还go+w
向同一目录授予权限,递归。但是当我尝试安装 drupal 7 时,它显示
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.
但是我有/sites/default/files
我手动创建的目录。ls -l
目录如下:
[root@localhost drupal]# ls -l
total 240
-rw-rw-rw-. 1 root root 6553 Mar 31 06:43 authorize.php
-rw-rw-rw-. 1 root root 75229 Mar 31 06:43 CHANGELOG.txt
-rw-rw-rw-. 1 root root 1481 Mar 31 06:43 COPYRIGHT.txt
-rw-rw-rw-. 1 root root 720 Mar 31 06:43 cron.php
drwxrwxrwx. 4 root root 4096 Mar 31 06:43 includes
-rw-rw-rw-. 1 root root 529 Mar 31 06:43 index.php
-rw-rw-rw-. 1 root root 1451 Mar 31 06:43 INSTALL.mysql.txt
-rw-rw-rw-. 1 root root 1874 Mar 31 06:43 INSTALL.pgsql.txt
-rw-rw-rw-. 1 root root 688 Mar 31 06:43 install.php
-rw-rw-rw-. 1 root root 1298 Mar 31 06:43 INSTALL.sqlite.txt
-rw-rw-rw-. 1 root root 17861 Mar 31 06:43 INSTALL.txt
-rw-rw-rw-. 1 root root 18092 Mar 31 06:43 LICENSE.txt
-rw-rw-rw-. 1 root root 8191 Mar 31 06:43 MAINTAINERS.txt
drwxrwxrwx. 4 root root 4096 Mar 31 06:43 misc
drwxrwxrwx. 42 root root 4096 Mar 31 06:43 modules
drwxrwxrwx. 5 root root 4096 Mar 31 06:43 profiles
-rw-rw-rw-. 1 root root 5376 Mar 31 06:43 README.txt
-rw-rw-rw-. 1 root root 1561 Mar 31 06:43 robots.txt
drwxrwxrwx. 2 root root 4096 Mar 31 06:43 scripts
drwxrw-rw-. 4 root root 4096 Mar 31 06:43 sites
drwxrwxrwx. 7 root root 4096 Mar 31 06:43 themes
-rw-rw-rw-. 1 root root 19416 Mar 31 06:43 update.php
-rw-rw-rw-. 1 root root 9642 Mar 31 06:43 UPGRADE.txt
-rw-rw-rw-. 1 root root 2051 Mar 31 06:43 web.config
-rw-rw-rw-. 1 root root 417 Mar 31 06:43 xmlrpc.php
并且ls -l
是sites/default/files
[root@localhost default]# pwd
/var/www/html/drupal/sites/default
[root@localhost default]# ls -l
total 28
-rwxrw-rw-. 1 root root 23197 Mar 31 06:43 default.settings.php
drwxrwxrwx. 2 root root 4096 Mar 31 06:48 files
答案1
Fedora 使用 SELinux 进行访问控制,也许您必须使用setsebool
&chcon
命令来更改 SELinux 的目录上下文,如下所述: