0

So recently I had migrated my site to amazon Vps and getting too many permissions errors.

I have already changed all folder permissions to > 755 and all file to > 644.

Also, given chown of wp-upload to www-data.

But I still can't upload files to WP site, and also plugins too, showing permission error (can't make dir).

What I have done wrong here?

UPDATE:

" ls -lZ " for wp-content

-rw-r--r--  1 www-data www-data ?  596 Mar 30 05:36 advanced-cache.php
drwxr-xr-x 10 www-data www-data ? 4096 Mar 28 21:11 cache
-rw-r--r--  1 www-data www-data ? 1399 Mar 28 21:10 db.php
-rw-r--r--  1 www-data www-data ?   28 Jan  8  2012 index.php
-rw-r--r--  1 www-data www-data ? 4517 Mar 28 21:10 object-cache.php
drwxr-xr-x 45 www-data www-data ? 4096 Apr  3 13:48 plugins
drwxr-xr-x  7 www-data www-data ? 4096 Apr  3 13:48 themes
drwxr-xr-x  2 www-data www-data ? 4096 Mar 28 21:53 updraft
drwxr-xr-x  2 www-data www-data ? 4096 Mar 28 23:00 upgrade
drwxr-xr-x 10 www-data www-data ? 4096 Dec 31 18:31 uploads
drwxr-xr-x  2 www-data www-data ? 4096 Mar 28 22:33 w3tc-config
drwxr-xr-x  2 www-data www-data ? 4096 Mar 30 05:36 wp-rocket-config
  • 1
    what errors can you see in the logs? – Jakuje Apr 10 '17 at 13:41
  • @Jakuje writing error probably! when installing Wordpress plugin it says "Failed: Could not create directory" and on uploading media it says "The uploaded file could not be moved to wp-content/uploads" – Prashant Gupta Apr 10 '17 at 14:17
  • What permissions does wp-content/uploads have? Show the output using ls -lZ wp-content/uploads. – Valentin Bajrami Apr 10 '17 at 14:19
  • @val0x00ff for upload folder "" drwxr-xr-x 10 www-data www-data ? 4096 Dec 31 18:31 uploads "" – Prashant Gupta Apr 10 '17 at 14:35
  • @PrashantGupta please edit the question and show exactly what it looks like. Also ls -lZ will return SELinux context labels – Valentin Bajrami Apr 10 '17 at 14:41
0

Give www-data -group read/write/execute rights to wp-content and all subdirectories.

Eg:

chmod -R 775 wp-content
  • it works, but i just wanted to know is 775 safe? – Prashant Gupta Apr 10 '17 at 23:41
  • Safe depends on the server and configurations, but since you're on Amazon Virtual Private server, it should be A) safe and B) necessary. – DocWeird Apr 13 '17 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.