Mac系统XAMPP环境下WordPress图片上传失败问题求助
Hey there, let’s get that WordPress image upload issue sorted out on your Mac XAMPP setup. That error almost always comes down to file permission mismatches—here’s how to fix it step by step:
- Navigate to your XAMPP
htdocsfolder, then locate your WordPress installation’swp-content/uploadsdirectory. - Right-click on the
uploadsfolder and select Get Info. - Scroll down to the Sharing & Permissions section.
- Make sure the
_wwwuser (this is the user Apache runs as on Mac) and your personal Mac user account both have Read & Write access. - If permissions are incorrect, click the lock icon at the bottom right to unlock, adjust the permissions, then click Apply to enclosed items—this ensures subfolders like
2019/04inherit the correct settings.
Sometimes the Finder method doesn’t apply permissions deeply enough. Use Terminal for a thorough fix:
- Open the Terminal app on your Mac.
- Navigate to your WordPress root directory with this command (replace
your-wordpress-folderwith your actual folder name):cd /Applications/XAMPP/htdocs/your-wordpress-folder - Change the owner of the uploads directory to the Apache user:
sudo chown -R _www:staff wp-content/uploads - Set secure, correct permissions for the directory:
Note: When you enter your Mac password in Terminal, it won’t show any characters—just type it and press Enter.sudo chmod -R 755 wp-content/uploads
Double-check that your WordPress path configuration is correct:
- Log into your WordPress admin dashboard.
- Go to Settings > Media.
- Confirm the File upload path is set to
wp-content/uploads(the default setting—avoid using absolute paths here). - Ensure the Organize my uploads into month- and year-based folders option is checked (this matches the
2019/04path in your error message).
If you manually created the 2019/04 subfolder, it might have isolated permission issues. Repeat the permission adjustment steps specifically for that subfolder, and it should work.
Important: Never set folder permissions to 777—this creates a major security risk. Stick with 755 for directories and 644 for files.
内容的提问来源于stack exchange,提问作者kashif shabbir

