Recently I rebuilt the system for my server and created a new WordPress blog, but when I tried to upload pictures to the post, the upload process was interrupted by an error, it says that “The uploaded file could not be moved to ../wp-content/uploads”, what’s up?
So I was googling and found someone said that you should set the permission of wp-content/uploads folder to 777 like below:
chmod -R 777 wp-content/uploads
Yes, after I changed that, it was worked fine, however, you’d better don’t do that immediately! Don’t you think it’s dangerous for the server security? Of course, you may say that just change the permission back to 755, that’s OK! Yes, but it’s not a perfect solution, because when you upload the picture in the next time, you have to change the permission again and again. So, what shall we do?
Actually the root of the problem is the user and group setting on your server. Just try the following commands.
chown www-data:www-data wp-content/uploads chmod -R 755 wp-content/uploads
Then, tried to upload the picture again, it was working like a charm!