I just set up my 30th words install - love it.

For this project, I want to be able to create multiple sites and use Digitalocean's block storage to maintain the wp-content content. So I set up the first site and added block storage and then set up a symlink in the htdocs folder and replaced the wp-content folder (and contents after moving to the block storage folder called wp-content) with the symlink. The command was ln -s /mnt/volume_nyc1_01/wp-content/ /var/www/mynewwpsite.com/htdocs/wp-content.

Not being very familiar with symlinks, using them a handful of times over 20 years, this works as far as normal usage from the command line. I set the permissions on the linked mount all the way back to the root as www-data:www-data and all file permissions are at 777.

However, WordPress is not able to write to the content directory. The error message is confusing because it appears to be trying to create a directory that is already created. The message makes it seem that it is trying to create the directory structure in the htdocs directory rather than follow the symlink. Here is the message: “4thofjulyinfailingeconomy.webp” has failed to upload.
Unable to create directory wp-content/uploads/2024/07. Is its parent directory writable by the server? ".

The symlinked directory is already in place here: /mnt/storage/wp-content/uploads/2024/07 and for example I can cd to the htdocs folder and then do ll wp-content/uploads/2024/07 and see the contents of that linked folder.

Does anyone see something I missed or have done incorrectly?

Thank you as always,

S

a month later

Usually, you’ll have 750 permissions for your directories and 640 for the files. However, in some cases, this won’t be sufficient.

Running 755 for directories and 644 for files is also an option.

Hosted by VirtuBox