简体   繁体   中英

Joomla 3.4 folder permission issue

I have migrated my site to new server using Akeeba Backup. The environment of new server is 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. However all files/folders in System Information -> Folder Permission are all Unwritable .

I have tried any possible solutions I can figure out, can anyone help?

php-fpm and nginx is run by 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

-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
    $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

If you create a test php file in your root directory with just

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

and then access it with a browser, do you see www-data or is it something else?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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