WP uploaded custom media directory cant be written to even with correct permissions (777)

May 14, 2018 521 views
WordPress Apache Configuration Management

I created a custom folder to host my media files in my wp install called media
Now even with the correct permissions library uploads as well as plugins cannot write files here. Unless I change permission to 777 I cannot normally upload (I want to use 755).
And even on 777 WooCommerce cant “Log directory writable”

I believe the issue might be see here as the folder owner/group of everything I ftp upload changes to root root. As seen here: https://i.imgur.com/wWJ3f43.png

Can anyone tell me how to change this? Or does someone know where else the issue could come from?

Thanks a lot in advance!

Here you can see how I added the folder to my wp-config.php: https://i.imgur.com/ef3Jg7y.png

1 Answer

Try this:

chown -R www-data:www-data /var/www/html
Have another answer? Share your knowledge.