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

Posted May 14, 2018 1.1k views
ApacheWordPressConfiguration 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:

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:

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Try this:

chown -R www-data:www-data /var/www/html