简体   繁体   English

Joomla 3.4文件夹权限问题

[英]Joomla 3.4 folder permission issue

I have migrated my site to new server using Akeeba Backup. 我已使用Akeeba Backup将我的站点迁移到新服务器。 The environment of new server is Ubuntu 16.04 LTS + nginx 1.10.0 + Joomla 3.4.8 + PHP 5.6 新服务器的环境是Ubuntu 16.04 LTS + nginx 1.10.0 + Joomla 3.4.8 + PHP 5.6

I can see my site running well and I can also login to admin tool, which means nginx, php-fpm, and mysql are running well. 我可以看到我的网站运行良好,我也可以登录管理工具,这意味着nginx,php-fpm和mysql运行良好。 However all files/folders in System Information -> Folder Permission are all Unwritable . 然而,所有的文件/文件夹中的System Information -> Folder Permission不可写

I have tried any possible solutions I can figure out, can anyone help? 我已经尝试了任何可能的解决方案,我可以弄明白,有人可以帮忙吗

php-fpm and nginx is run by www-data . php-fpm和nginx由www-data运行。

$ ps aux|grep fpm
root      1293  0.0  3.4 249700 20592 ?        Ss   06:27   0:00 php-fpm: master process (/etc/php/5.6/fpm/php-fpm.conf)
www-data  3397  0.2  7.5 259964 45384 ?        S    06:57   0:04 php-fpm: pool www
www-data  3403  0.2  7.5 259952 45244 ?        S    06:57   0:04 php-fpm: pool www
www-data  3405  0.2  9.0 269948 54716 ?        S    06:57   0:03 php-fpm: pool www

$ ps aux|grep nginx
root      1348  0.0  0.2 125192  1500 ?        Ss   06:27   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data  1349  0.0  1.1 125584  6840 ?        S    06:27   0:00 nginx: worker process

All files are 644 and folder are 775 under /usr/share/nginx/html /usr/share/nginx/html下的所有文件都是644,文件夹是775

-rw-r--r--  1 www-data www-data    15 May 22 15:18 404.html
-rw-r--r--  1 www-data www-data    15 May 22 15:18 50x.html
drwxrwxr-x 10 www-data www-data  4096 May 22 15:18 administrator/
drwxrwxr-x  2 www-data www-data  4096 May 22 15:18 bin/
drwxrwxr-x  4 www-data www-data  4096 May 22 15:18 cache/
drwxrwxr-x  2 www-data www-data  4096 May 22 15:18 cli/
drwxrwxr-x 33 www-data www-data  4096 May 22 15:18 components/
-rw-rw-r--  1 www-data www-data  3240 May 24 07:18 configuration.php
-rw-r--r--  1 www-data www-data   586 May 24 06:59 dir.php
-rw-r--r--  1 www-data www-data  2915 May 22 15:18 htaccess.txt
drwxrwxr-x  6 www-data www-data  4096 May 22 15:18 images/
drwxrwxr-x  2 www-data www-data  4096 May 22 15:18 includes/
-rw-r--r--  1 www-data www-data  1211 May 22 15:18 index.php
-rw-r--r--  1 www-data www-data    20 May 22 15:18 info.php
-rw-r--r--  1 www-data www-data  1873 May 22 15:18 joomla.xml
drwxrwxr-x  6 www-data www-data  4096 May 22 15:18 language/
drwxrwxr-x  5 www-data www-data  4096 May 22 15:18 layouts/
drwxrwxr-x 15 www-data www-data  4096 May 22 15:18 libraries/
-rw-r--r--  1 www-data www-data 18092 May 22 15:18 LICENSE.txt
drwxrwxrwt  2 www-data www-data  4096 May 23 14:46 logs/
drwxrwxr-x 32 www-data www-data  4096 May 22 15:18 media/
drwxrwxr-x 36 www-data www-data  4096 May 22 15:18 modules/
drwxrwxr-x 29 www-data www-data  4096 May 22 15:18 plugins/
-rw-r--r--  1 www-data www-data    53 May 22 15:18 README.md
-rw-r--r--  1 www-data www-data  4213 May 22 15:18 README.txt
-rw-r--r--  1 www-data www-data   296 May 22 15:18 robots.txt
-rw-r--r--  1 www-data www-data   842 May 22 15:18 robots.txt.dist
drwxrwxr-x  9 www-data www-data  4096 May 22 15:18 templates/
drwxrwxrwt  2 www-data www-data  4096 May 22 15:18 tmp/
-rw-r--r--  1 www-data www-data  1690 May 22 15:18 web.config.txt

I also write PHP script to check the permission and it shows files under /usr/share/nginx/html/ are still not writable. 我还编写PHP脚本来检查权限,它显示/usr/share/nginx/html/文件仍然不可写。

<?php
    $root = getcwd();      

    echo exec('whoami')." ";
    echo "$root ";

    echo is_readable("/usr/share/nginx/html") ? 'yes ' : 'no ';     
    echo is_writable("/usr/share/nginx/html") ? 'yes ' : 'no ';

    echo is_writable("/tmp") ? 'yes ' : 'no ';
?>

The result shows "www-data /usr/share/nginx/html yes no yes" even the owner is www-data:www-data and mode is 755 on /usr/share/nginx/html 结果显示“www-data / usr / share / nginx / html yes no yes”即使所有者是www-data:www-data和模式是755 on /usr/share/nginx/html

If you create a test php file in your root directory with just 如果你只是在根目录中创建一个测试php文件

<?php echo exec('whoami'); ?>  

and then access it with a browser, do you see www-data or is it something else? 然后用浏览器访问它,你看到www-data还是其他的东西?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM