πŸ“Œ Goal:

Allow WordPress to write/upload media without permission issues.


πŸ”§ Command:


sudo chown -R www-data:www-data /var/www/mytestsite/wp-content/uploads

🧠 Breakdown:

Part Meaning
www-data:www-data Make the web server the owner and group
-R Recursive (everything inside uploads)

βœ… What It Does:

⚠️ Without this, WordPress will show errors like β€œunable to create directory.”


βœ… Final Tip:

Use a mix of ownership: