Directory permissions issue
April 2, 2025 · AI Conversations
Here’s how to fix it:
—
### ✅ **Step 1: Check Permissions**
Make sure the `wp-content/uploads` directory is writable by the web server.
#### Connect via SSH or FTP and run:
chmod -R 755 wp-content/uploads
If that doesn't work, try:
chmod -R 775 wp-content/uploads
> In some rare cases, you might need `777` temporarily to test, but **do not leave it at 777** for security reasons.
—
### ✅ **Step 2: Check Ownership**
The directory might not be owned by the correct user.
#### Run this (replace `www-data` with your web server user if different):
chown -R www-data:www-data wp-content/uploads
> For Apache on Ubuntu, the web server user is typically `www-data`.
—
### ✅ **Step 3: Confirm Upload Path in WordPress**
1. Go to `Settings > Media`
2. Check the **“Store uploads in this folder”** field.
– It should be something like:
wp-content/uploads
– If it's empty or incorrect, correct it.
—
### ✅ **Step 4: Try Manually Creating the Folder**
If WordPress can’t auto-create the folder, create it manually via SSH or FTP:
mkdir -p wp-content/uploads/2025/04
chmod -R 755 wp-content/uploads/2025/04
chown -R www-data:www-data wp-content/uploads/2025/04
—
Let me know if you're on a shared host, Docker, or using a specific control panel (like cPanel or Plesk), and I can tailor the fix for that setup.