Have you tried to upload an image to your WordPress blog and got this error message?
“Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server.”
This is a common WordPress error that can prevent you from adding images and other media files to your blog posts. It can also affect your site’s performance and security.
In this post, we will help you fix this error with ease and show you what causes it. You’ll also learn how to avoid this error in the future and keep your WordPress site running smoothly.
For me, this error message originally appeared after migrating WordPress Made Easy from a WordPress hosting provider to another one, when I started to write a new post as usual. When I tried to add an image to the post, the upload process failed and this error message appeared:
Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server.
In the beginning, I thought that the cause of the problem might be the lack of permissions on the new web hosting server.
I connected to my FTP server using FileZilla and started to check the wp-content/uploads sub-folders to see if the folder of the current month had been created or not, and it was there.
After that, I thought the cause of the problem may be caused by incorrect file permissions as WordPress was unable to upload files (write data) to the folder, so I changed the permissions via FTP.
However, I still couldn’t upload files to the WordPress media library and was still getting the “Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server” error when I tried to upload the files even after using another browser to write post.
What Causes The “Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server” error
The cause of this error is that the wp-content/uploads folder does not exist because when I installed WordPress on the old server it automatically extracted the old path for uploads folder.
That old path includes the user account of the server and when I migrated to the new server the username changed so for WordPress the folder does not exist because it is looking for a path that is different from the current new path.
Looking for a good SEO plugin for WordPress?
Here’re the Best WordPress SEO Plugins (picked by an expert)
How to Fix The “Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server” error
To solve this annoying error, you simply need to change the path of the wp-content/uploads folder to one of the current uploads folder on your current web hosting server.
To do so, follow these steps to solve the problem:
1. Log in to your WordPress admin dashboard (wp-admin).
2. In the left menu go to Settings -> Media
3. In the Store uploads in this folder field, enter wp-content/uploads
and click Save Changes.
NOTE: make sure that the Store uploads in this folder field contains wp-content/uploads
only.
That’s it. Now, go and try to upload files to the media library again and the error should not appear again.
I can’t find the “Store uploads in this folder” field on my Media Settings page!
Please note that that option has been removed from newer WordPress versions. So, if you can’t find the “Store uploads in this folder” field on your media settings page, we will solve the problem programmatically using a single line of PHP code.
Use any FTP client such as FileZilla (or your hosting control panel’s online file manager) to edit the WordPress wp-config.php file.
Now, copy this line of code and add it to the wp-config.php file:
define( 'UPLOADS', 'wp-content/uploads' );
just above this line (usually the last line in the file):
require_once ABSPATH . 'wp-settings.php';
Now, save the file.
If you are using FTP to edit it, re-upload the updated file to your web hosting, and make sure to overwrite the existing file.
The “Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server” error will be fixed.
Looking for good hosting?
Here are The Best WordPress Hosting providers of this month
For LocalHost Installs (XAMPP)
If you’ve installed WordPress locally, and face the error message and none of the above solutions fixed your problem.
You may need to reset the ownership of the installation to nobody by doing the following.
1. Run command line/terminal:
- On Mac:
Applications -> Utilities -> Terminal - On Windows:
Start -> Programs -> Accessories -> Command Prompt
2. Run the following command
After replacing wordpress
with your actual WordPress installation directory.
sudo chown -R nobody:staff /applications/xampp/xamppfiles/htdocs/wordpress
Do you still get the “Unable to Create Directory wp-content/uploads…” error message?
If you can’t solve the problem and the “Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server” error message still appears, let me know by adding a comment below and I will help you to fix the problem.
Hari says
Thanks for this valuable information. My problem has been resolved successfully.
WP-ME.com says
Hi Hari,
We’re happy we could help 🙂
Jakob Mühlberger says
After hours of searching, I finally found the right solution. It’s that simple – thank you very much.
WP-ME.com says
Glad we could help you 🙂
Gwenn says
Bonjour,
Je désespère, rien ne fonctionne pour moi…
Dans votre solution 1 : impossible de trouver le champ “Stocker les téléchargements dans ce dossier”.
Dans votre solution 2 : impossible de trouver la ligne “require_once(ABSPATH . ‘wp-settings.php’);”
Dans votre solution 3 : je comprends rien ! à l’aide
WP-ME.com says
Bonjour,
Je suis désolé d’apprendre que vous rencontrez des difficultés. La ligne require_once(ABSPATH . ‘wp-settings.php’); est généralement la dernière ligne du fichier wp-config.php. Si vous ne la trouvez pas, il est possible que votre fichier de configuration ait été modifié ou que vous ne regardiez pas le bon fichier.
Pour la solution 1, si vous ne trouvez pas l’option « Stocker les téléchargements dans ce dossier », elle a été supprimée des versions plus récentes de WordPress.
La solution 3 est destinée aux utilisateurs qui ont installé WordPress localement, et non aux propriétaires de sites web avec hébergement web. Par conséquent, si vous n’avez pas installé WordPress sur votre ordinateur local, vous devriez ignorer cette solution.
In English:
Hello,
I’m sorry to hear that you’re having trouble. The line
require_once ABSPATH . 'wp-settings.php';
is usually the last line in thewp-config.php
file. If you can’t find it, it’s possible that your configuration file has been modified, or you might not be looking at the correct file.For solution 1, if you can’t find the “Store uploads in this folder” option, it has been removed from newer WordPress versions.
Solution 3 is intended for users who have installed WordPress locally, not for website owners with web hosting. Therefore, if you do not have WordPress installed on your local computer, you should disregard this solution.
Jim Caratozzolo says
I have installed XAMPP on my mac desktop and then WordPress. Created a database and have wordpress running. but get error message: Installation failed: Could not create directory. /Applications/XAMPP/xamppfiles/htdocs/wordpresscopy/wp-content/upgrade/classic-editor.1.6.2.
seems like i’m getting closer as the error message seems to go deeper into my file system than earlier messages.
Here is my wp-config.php files:
** Removed for Privacy **
WP-ME.com says
It seems to me that you might be running out of disk space, or you don’t have the right file permissions.
Also, note that in your
wp-config.php
file, the last line/*define( 'UPLOADS', 'wp-content/uploads' );*/
is commented (disabled), you can uncomment it by replacing it withdefine( 'UPLOADS', 'wp-content/uploads' );
as mentioned above.Michał says
Half a day lost and finally a solution. Thanks for the help.
Tyson says
Had to go to PHPMYadmin directly and go to wp_options, looked for upload_path and then change option_value to wp-content/uploads (rather…just assign it that value cuz it was just blank….still a little puzzled how that could be the case on a brand spanking new fresh install of WP using XAMPP on local Mac OS…). Also had to go to wp-content folder in Finder on Mac and literally make a folder called “uploads”, THEN had to give it Read/Write permissions for everybody. Now it’s FINALLY working. I can add images to WP and it saves them in uploads. Oh, but I’m STILL not getting the “Store Uploads in this folder” prompt under Settings/Media of WP. So I guess if I want to ever change that to a different folder I’ll have to just use PHPmyadmin. Seems like a lot of work to just make WP just allow me to add an image to a post and work the way it already should. Now I know why I just prefer html/css and square space. WP truly does suck.
Srishti says
Thanks! Your comment helped solve my problem!
Tyson says
Still no joy. Fresh install of WP on local Mac OS Ventura and just one problem after another. First it was MySQL wasn’t running, then .htaccess file didn’t have permissions, now it’s giving me this error of Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server in WordPress. And I can’t even get it to create the Store uploads in this folder in Media Settings Page. Tried everything. Tried reassigning to nobody. Didn’t work. So…I’m at a loss….
New to WP and honestly if it’s this bad from the very beginning of a new WP install, gotta say, feels like junk imo.
Edgar says
Thank you. You Saved me 🙂
Johnny says
This solution was exactly what I needed! Thank you so very much!
Sohail says
Good Job. I was assumed this was server issue, but you saved my time thanks.
Bazil Nesbitt says
Sincere thanks. I encountered this problem after moving hosting accounts. After a brief and fruitless ftp session, I found YOUR solution, and can confirm that it works perfectly straight after the first step !!!
Rebecca says
BINGO. Thanks for the quick easy fix
will says
I’m on a localhost installation. I tried what you said and got this:
chown: /applications/xampp/xamppfiles/htdocs/wordpress: No such file or directory
WP-ME.com says
Replace the word
wordpress
in the command with your WordPress installation folder.For example, if WordPress is installed in a folder called
site
, the path should be:/applications/xampp/xamppfiles/htdocs/site
Nick says
Great tip on the fix for not being able to upload images.
skp says
Awesome! Thank you, exactly what I needed
Ravenari says
Thank you SO SO much for this fix! I tried a couple of other articles, but your info is the most up to date and it worked immediately while preserving the pathway to my other images. Thank you again.
Ayman Radwan says
Hi Mr. Ahmed,
I’m working on XAMPP localhost server, for re-designing our website by using OceanWp theme on WordPress.
when I have tried to upload the oceanwp.3.0.3.zip file, this error message has occurred for me:
“Unable to create directory wp-content/uploads/2021/08. Is its parent directory writable by the server?”.
After reading this article, I have tried all methods that have mentioned in it, but the problem is not fixed , and the message error is still appear, What you advise me to do now?
Do I download the above mentioned file using FileZilla or any other FTP software, and edit the file and upload it again to our website and replace the file on your website with the edited one, as you have advised one body here? or what?
thank you.
WP-ME.com says
Hey Ayman,
Local server is known for causing problems like that since it is not as important or actively-developed as production environments (live servers).
My advice is to install another WordPress install in another folder and use it instead of the current one.
if that didn’t work, try reinstalling the local server itself.
P.S. you don’t need FTP software to work with local servers, you can use your OS’s file explorer.
Ayman Radwan says
Thank you very much for your replying,
I would apply your advise, but I want to inform you the following info:
I used MAMP as a localhost server before that and installing WordPress on it , and everything was OK.
Then, I have decided to change to XAMPP localhost server, thus, I removed MAMP, then I installed a fresh copy of WordPress again on XAMPP after installing it.
P.S. I’m using OS mac (High Sierra)
Ayman Radwan says
Hey Mr.Ahmed,
Now, the error message has been gone, but when I click on “install now” button, there is a dialog box appear for me titled with: connection information says:” To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host”, it requests to enter three information: Hostname – FTP Username – FTP Password.
Then there are two options: FTP & FTPS (SSL) to choose of them.
WP-ME.com says
It appears that there’s a problem with file permissions as this error message appears when WordPress can’t write to the files in the WordPress tree.
Try adding the following line to
wp-config.php
file above the database configuration:define( ‘FS_METHOD’, ‘direct’ );
moffzar says
Hi guys,
I find another solution which by removing debug.log file inside wp-content folder
I find out that the log file was too big ,3Gb.
Susan James says
Thank you so much! I’ve had this problem and couldn’t find a solution that was straightforward and worked 🙂
Henry says
Thanx a load this really worked for me, before permission this is the first thing we need to check and everyone ignored this.
Calvin says
WOW! This was the EASIEST solution. All these other threads were so useless and the problem was so simple to fix. Thank you!
PL says
so much thanks for helping me!
greetings from PL 🙂
John says
Thanks for posting this.
I didn’t have the “Store uploads in this folder field” (step 3) inside the WP settings,
but I was able to add the “uploads” folder in the terminal.
This post definitely helped me get better at navigating Linux.
I appreciate the help.
– John
haidir says
hello, I have a problem uploading my photo using the method above. I am using wordpress version 5.6.1
WP-ME.com says
If you tried all the solutions above and none of them worked, you may need to reach out to your hosting provider.
Sal says
Thank you! This worked!
Cindy says
So helpful! This worked for me. Thank you so much!!!
Helen says
Thank you for this – Super easy instructions to fix my problem.
Gabriela says
Thanks! You help me a lot!!!!
Miki English says
Thank you! I was having the exact issue and your solution worked perfectly.
Kelly says
Hi there,
I have wordpress installed locally and used:
sudo chown -R nobody:staff /Users/(my user name)/.bitnami/stackman/machines/xampp/volumes/root/htdocs/wordpress
Which is the path to the wordpress folder I’m using. I input my user password and then got a very long list of messages ending in “Operation not permitted”
I then tried just doing
sudo chown -R nobody:staff /applications/xampp/xamppfiles/htdocs/wordpress
just for the heck of it, but course that file directory doesn’t exist.
I’m really new to this and am just wondering what I’m doing wrong? Am I misunderstanding what the “WordPress installation directory” is?
WP-ME.com says
Hi Kelly,
It appears to be user permission and your user account does not have sufficient permissions to change the folder permissions of Bitnami’s folders.
I’d recommend posting this issue on Bitnami Community forums or reinstalling WordPress in another folder.
namitz says
hey kelly ,
iam in the same position – using localhost xampp on mac and stuck on same problem as you…. did you figured something out ? if yes plz share
Akanksha says
I tried many option but still error is coming that ” unable to create directory, is it parent directory writable by server” . please help help me out
WP-ME.com says
Hi Akanksha,
If none of the solutions above worked for you, try reaching out to your hosting provider.
If you’re using a local server, try reinstalling WordPress in a different folder.
Kaushik says
Hey There,
Thank you a lot for your help. I had the same problem ” Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server” which I have solved going to media section.
Manthan Admane says
This helped me 🙂
Thank you.
Harkesh Dudhat says
i still facing this eror in my mac please help me i try this command in terminal but in terminal also showing this err that no such file
WP-ME.com says
Hey Harkesh,
Try the solution in comment #20042.
If it does not fix the problem, I’m afraid you might need a fresh WordPress installation.
Ayush Jain says
Thanks for sharing,
Amit says
Hey,
This was extremely thankful and worked for me. i was stuck for past 3 days and after checking this i got the solution. Thanks to you. You are a champ.
Sophia Brown says
Thanks You Very Much sir, it is perfectly work for me.
Olivia Frederick says
THANK YOU!!!!!
Richard Smith says
Thanks so much for this, it was driving me nuts
Carlos says
Hey Ahmed,
I’m running a local install of WP on XAMPP, I design websites on a local environment. When I try uploading picture to the woocommerce store is when I receive the comment of Unable to create directory wp-content/uploads/2020/02. Is its parent directory writable by the server? I’ve completed all the steps above with no luck. Changed the file permissions as well as updated the wp-config.php file. I still don’t have an option to update file locations on the settings —> media area. I’ve been looking all over to fix this issue with no luck. Any suggestions would be greatly appreciated. Thank you.
WP-ME.com says
Hey Carlos,
Try reinstalling WordPress and if it didn’t work, try reinstalling XAMPP itself.
Carlos says
Thank you. I’ll give those options a try.
Carlos says
Thanks Ahmed,
I figured out the issue. XAMPP uses daemon as user when using permissions on WP, when I change the user to PC user or nobody:staff to change config files XAMPP no longer had write permission. I turned write permission back to deamon and it worked. So if anyone uses XAMPP you must turn write permission back to deamon in order to use WP successfully.
WP-ME.com says
Glad to hear that you could fix it and thanks for sharing that with us Carlos.
bob says
please try to erabrate how it works
majd eddine says
yes, this worked for me
Tissy Joseph says
Oh.. Boy! You are really blessed! I nearly went really mad and then I saw your post. It worked very well for me. A million thanks! God Bless you and your family!
Best regards
Tissy Joseph
Ashish Bafna says
Thank you so much. It worked for me and helped me a lot
Clay Ravin says
Thanks for this!
Vishal says
Hey Ahmed!
I’m unable to update my wordpress.
And the error is:
Downloading update from …
Unpacking the update…
Could not create directory.
Installation Failed
Please help me resolve this issue asap.
WP-ME.com says
Hey Vishal,
It looks like there is a problem with file permissions.
Your Web Hosting provider should be able to fix it or try to update the file permission to 755 and let me know if it worked.
Annie says
Thanks very much! Simple fix 🙂
Shweta says
Hi Ahmed,
I ran “sudo chown -R nobody:staff /applications/xampp/xamppfiles/htdocs/wordpress” (with my file name) in the Terminal but somehow it doesn’t detect the file. This is the error I get: “chown: /applications/xampp/xamppfiles/htdocs/innovation: No such file or directory”. What could be the problem?
Thank you in advance!
WP-ME.com says
Hi Shweta,
It looks like you’ve installed WordPress in a different directory rather than
wordpress
.Change
wordpress
in/applications/xampp/xamppfiles/htdocs/wordpress
use the directory/folder where you installed WordPress and try again.AVINASH BARAK says
Thank you, friend. This piece of information was a life saver. Cheers!
Mihails says
Hello Ahmed I have tried the “I can’t find the “Store uploads in this folder” field in my Media Settings page?” solution which is to edit the wp-config.php file. But after editing the file by inserting the 2 new lines of code. When i try to go the the website i get this error “Your wp-config.php file has an empty database perfix, which is not supported”.
Mihails says
I’m using my own linux server for hosting
Mihails says
I fixed it. I was trying to upload a picture and was getting this error. So i changed the owner of the folder “wp-content” and of “wp-content/uploads” to www-data and now i can upload pictures because it creates the new directories (dirs like 2019/04 etc).
Maria says
Alright!!
Anne Hutchins says
Thanks so much, Ahmed! Easiest WordPress fix so far.
Mathilde says
Hi Ahmed, I tried adding the code line to my php file, unfortunately I still get the error message. I hope you can help me fix this issue.
WP-ME.com says
Hi Mathilde,
If you tried all of the above solutions and none of them worked, I’d recommend contacting your hosting support team as it might be something with server configurations.
mayank says
Thank you so much Ahmed Elgameel sir, I have solved the issue easily with your suggestion, thank you so much again.
Nyk says
Hello Mate,
I would like to thank you for this information as below code help me to sort out the problem.
define( ‘UPLOADS’, ‘wp-content/uploads’ );
Thanks you very much!
Paul says
Thanks so much for this missing piece of the puzzle! I did everything like you did with file permissions, etc. and even added the root directory + subfolder path to the wp-content/uploads, but nothing worked. I was doing too much!
wp-content/uploads was all I needed. Thanks so much for the “right” answer!
Rashtradeep Tripathi says
I am getting this problem and can’t solve it, please help. I only have FTP access, tried changing permissions from filezilla but it says “Command not understood”. Please Help!
WP-ME.com says
Did you try the wp-config.php file’s method above?
Akinniyi Ayodeji says
yes i did, this is still what i get.
The uploaded file could not be moved to wp-content/uploads.
WP-ME.com says
The problem may be with file permissions, try another FTP client rather than FileZilla or simply ask your hosting provider to change them for you.
Aij says
Hey Akinniyi Ayodeji & Team,
Kindly edit the folder properties of the folder “uploads” by right-clicking on it and editing the security properties. Ensure that the user priviledges assigned to System user, Administrator user, Users, Trusted installer are all set to Full control. Click on Apply button and press Ok.
Trying process of uploading contents to your wordpress website again.
Bravo! Let me know if it works.
al kayes says
thank you so much. its work for me thank you
Lauren says
Hi there,
This has proved very useful but I’m still having the problem. I have WordPress installed locally and have tried each of your solutions to no avail. Any other thoughts?
WP-ME.com says
Try changing the permissions of the folder, if it doesn’t solve the problem too try backing the files & Databases up and reinstall the local host.
Lauren says
I did try that, and also installed a fresh tester site this morning and still having the issue.
WP-ME.com says
Then this might be caused by insufficient permissions or your anti-virus.
Try changing the permissions of the folders and disable your AV.
Wabke says
Thank you so much! You made my day 🙂
WP-ME.com says
Glad to hear that!
avinash singh says
mine too
Oleksiy says
I’ve tried everything. It wasn’t working.
But after creating subdirectory manually it worked for me.
Beverly says
This works for me after changing the permissions for the parent directory to read and write. I’ve been looking for a solution to this problem for the last half an hour and your blogpost really helped me out. Thanks a lot 🙂
Wendy says
Thanks! It worked 🙂
Maarten says
Hi Ahmed,
Thanks for all the effort you put into this, I am sure its greatly appreciated by everyone!
I am running a localhost with XAMPP on OSX. In the wordpress dashboard -> setting -> media the upload section doesn’t show.
– I changed the wp-config.php file according to how you described it in your post.
– I changed the permission of the XAMPP folders in my finder to ‘read and write’. (For user: ‘Maarten’) The other two ‘users/groups’ (authedusers + everyone) have the permission to only read it. I tried to change these to ‘read and write’ as well, but I wasn’t allowed to change this setting for these two. However, I don’t think this seems to be the problem.
Do you have any idea how to fix this problem?
Thanks in advance!
Maarten
WP-ME.com says
Hi Maarten,
The following solution may help you.
1. Run the Terminal: Applications => Utilities => Terminal.
2. Run the following command after changing ‘wordpress’ to your WordPress installation directory:
sudo chown -R nobody:staff /applications/xampp/xamppfiles/htdocs/wordpress
jorge says
Hi Ahmed Elgameel, i installed wp in my local machine and i getting the same error message and i also tried the terminal command and not fix my problem. i’m still getting the same error message.
WP-ME.com says
Hi Jorge,
Check the permissions and it may also be caused by your antivirus.
If none of the solutions worked, try reinstalling WordPress or the Local server.
Rob Reister says
I have this issue, had upgraded to latest WordPress 4.9.1 without issue. But now I can NOT upload new media with the error given on this subject. I’ve tried setting permissions to 755, spent over an hour on the phone with GoDaddy with tier 2 support, still not resolved. Last month, before I upgraded WP to 4.9.1, it worked fine. But now it seems WP can’t create the directory for “12” month so it fails.
Rob Reister says
Also, I manually created the “12” directory with FTP, but when uploading now I get :
“2017 Fast Trax Holiday Special 1024.jpg” has failed to upload.
The uploaded file could not be moved to wp-content/uploads/2017/12.
Rob Reister says
After 4 phone calls, and talking with different levels of support at GoDaddy, it is now resolved. They said there were “permission issues” on my shared server space. Its now working normally.
Farah says
It worked great 🙂 Thanks for sharing
Ghanshyam Mourya says
Sir
I am using xampp control server 3.2.2 (apache & mysql) with WordPress 4.9.1 on windows 10 pro 64bit . I am trying to upload images or installing new themes but getting the following error:
The uploaded file could not be moved to wp-content/uploads/2017/12.
I already change the permission of folders to full control.
Please resolve my problem.
WP-ME.com says
Have you tried the first solution by changing the uploads folder?!
Ghanshyam Mourya says
Sir
The path is already created but it showing the following error
The uploaded file could not be moved to wp-content/uploads/2017/12
Following is the path for directory
C:\xampp\htdocs\WP\wp-content\uploads\2017
WP-ME.com says
Try the last solution by adding the code to your wp-config.php file.
And if the problem persists, try to reinstall XAMPP again after taking a backup.
Amol Gujar says
Thanks Sir Its Working For me, I am trying from three days but your post solve my problem, thank you very much
assia chemlali says
Hi Ahmed,I’ve tried all of the above and still coming up with the same error.
WP-ME.com says
Hi Assia,
Have you tried to contact your hosting support? they may have done some changes to your account.
Lucas says
I made made these stuffs but it not worked, the problem here was the directory permissions.
Solution: change the wp-content.php permissions to be able to edit it. (You can do it just by going to the folder proprieties)
WP-ME.com says
Hey Lucas,
Thanks for sharing your experience with us. Yet, you need to be careful while editing file permissions for security concerns.
Madison says
I already tried all the method you mentioned in the article
but I still cannot upload any media on my wordpress?
Do you have any suggestions?
WP-ME.com says
Try to contact your hosting provider, it might be a server-level issue.
Beth Marcil says
Thanks so much! This worked like a charm!
Shailesh Chaudhary says
thank You so much, Now i can Upload Media file Successfully,
Alex Maury says
Hi! I’m having the same error msg even after I made those changes to the wp-config.php. I’m using a localhost/ in MacOSX. How I can change the permissions to 777, I don’t know how to do that!? Thanks for your help man.
Alice says
i have the same issue. using localhost on mac and there is no uploads folder in the wp-content folder.
Mel says
Ahmed, you’re awesome! This was such an easy fix. Thank you so much!
WP-ME.com says
Glad I could help!
Thanks for your comment.
Peter G. says
Hi there Ahmed and thanks so much for what you do, helping everyone with their problems. I am running NGINX on Centos6 on VPS. I am getting this message, and nothing has worked to fix it. I searched WP for the string of the error message and it is printed from file “wp-admin/included/file.php”. I took out some “@” signs (error message suppression) to try to get some additional info. The resulting error message is:
Warning: move_uploaded_file(/var/www/mysite.com/html/script/wp-content/uploads/7.png): failed to open stream: Permission denied in /var/www/mysite.com/html/script/wp-admin/includes/file.php on line 376
Warning: move_uploaded_file(): Unable to move ‘/tmp/php3rLFVm’ to ‘/var/www/mysite.com/html/script/wp-content/uploads/7.png’ in /var/www/mysite.com/html/script/wp-admin/includes/file.php on line 376
“7.png” has failed to upload.
The uploaded file could not be moved to wp-content/uploads.
A quick check of folder “/tmp” shows no temp file there. The error is “failed to open stream”. It seems to the PHP upload to /tmp is failing. Maybe this has nothing to do at all with WP. I set the /tmp folder owner to same owner as NGINX and with read write permissions. Anything else you can think of that could help debug/fix this? Thanks again so much.
WP-ME.com says
Hey Peter,
The problem seems to be with permissions, I suggest you call your hosting support and they should fix it.
All the best.
Peter G. says
Hi there Me. Ahmed, and thanks for reply. I continued to debug this, and after temporarily chmod uploads folder to 777, I could upload and I noticed the owner of the uploaded file was “apache”! But I don’t have user “apache” on my system. Nginx and php-fpm are user “www-data”, no idea where user “apache” is coming from. But I chowned uploads folder to “apache” and it seems to work now with folder permissions set back to 755. Thanks again for your helpful blog!
WP-ME.com says
Thanks for your comment, as I said it is with permissions.
Glad I could help.
Shinfieldbaptistchurch says
Thanks so much. Your solution worked a treat. Even though I followed the instructions I was still expecting to have to spend a lot of time tweaking to make things work for me. But not at all. Problem solved in less than five minutes. Thanks so much
WP-ME.com says
Glad it helped.
jack says
Thanks Ahmed – God bless u ..
WP-ME.com says
Thanks for your comment Jack.
sherin says
Hi,
I have no “Store uploads in this folder” field in my Media Settings page,
So I used the code
define( ‘UPLOADS’, ‘wp-content/uploads’ ); before the line of
require_once(ABSPATH . ‘wp-settings.php’); on config.php
But still no “Store uploads in this folder” in my Media Settings page.any suggestions?
WP-ME.com says
This should solve the problem, not for showing the “Store uploads in this folder” in media settings page.
Try to upload files again.
Eko Permadi says
I was try your all recomendation. But not works. Any solutions?
WP-ME.com says
Contact your hosting provider.
Andrew Gauld says
Hi,
I’ve tried all of the above and still coming up with the same error.
Thanks
WP-ME.com says
Contact your host, the problem may be at their end.
Victor Ayala says
You have no clue how many hours I spent trying to fix this issue. Thanks for your post, you just saved my brain of going crazy.
Pat says
Thank You so much. This solved my problem after moving my site to a new server. It is all so complicated and looked for several day before I found your solution. Thanks again for taking time to provide help.
mukudzeyi says
hello. i am using local host server and getting error
Unable to create directory wp-content/uploads/2017/05. Is its parent directory writable by the server? i tried both above solutions and still getting the error..any suggestions?
Chris says
I met the same problem as you.
Pramathesh Palchoudhary says
New installation on AWS with NGINX
Using ‘define( ‘UPLOADS’, ‘wp-content/uploads’ );’ just renders my website dead
Only way was to give the folder 777 even 775 won’t work. Is there a way to just give 777 permission to NGINX or a particular user in this case?
Cannot leave it to 777 for reasons you’ve already touched upon
Athira Suresh says
Hello Ahmed,
I am completely new to WordPress, and I receive the following error message “Unable to moved to wp-content/uploads/2017/02” while trying to upload any kind of files. Could you please help me with this? Looking forward to your reply.
Thanks.
WP-ME.com says
Hi Athria,
If you tried all the solutions above and you still can’t upload files to WordPress. I suggest that you contact your hosting support team, and ask them to fix the issue.
okeke julios says
please sir, i have added define( ‘UPLOADS’, ‘wp-content/uploads’ ); to the wp-config.php file but that did not work, so how do i set the file permission to 775??
WP-ME.com says
I don’t recommend changing file permissions (for Security). Yet, you can change them using FTP program like FileZilla. Then connect to your FTP server using FileZilla, right click on the file / folder you want » choose File permissions… » and write the new permission in the Numeric value field and click OK.
shubham says
I have put that line as you said but it did not work. It can’t be hosting problem because i have other wordpress websites and they are working fine. So now how to resolve it?
WP-ME.com says
In this case you can contact your hosting company as the problem might be with file permissions and I don’t recommend changing them by yourself for security.
Andrew Robertson says
Hey, I’m a complete newbie at building websites, everytime i paste the code into the .php in dreamweaver and save i still don’t get the store uploads option.
I might be being really stupid here but like I said i’m a complete newbie at this.
Any help?
Thanks!
WP-ME.com says
Hi Andrew,
You need to add the code to the “wp-config.php” file on your website. So download that file using FileZilla or any other FTP software, edit the file and upload it again to your website and replace the file on your website with the edited one.
If this didn’t fix the problem, I’d recommend contacting your host to fix it as the issue might be with file permissions and changing them may affect your website’s security.
All the best.
Thomas says
I have this problem with uploads, I receive the error
“Unable to create directory wp-content/uploads/2017/03. Is its parent directory writable by the server?”
I followed your post and did all that was recommended but still issue was not resolved. I don’t have the text box “store uploads in this folder”
WP-ME.com says
If you don’t see the field “store uploads in this folder”, follow the guidelines above and add the code to your wp-config.php file and if this didn’t solve the problem, you may need to contact your hosting provider.
Thanks for stopping by!
Sibabale Joja says
I dont have a domain yet so I am using localhost but I still have the same problem evebafter making changes on the config file. On the setting -> media the upload section still doesn’t show. Is there another solution?
WP-ME.com says
Hi Sibabale,
File permissions may be the cause of the problem.
Sibabale Joja says
can you please send steps towards changing permission and not compromise on security.
WP-ME.com says
Since you’re using a local host, take a look at this comment and this one too.
Sibabale Joja says
Thanks Ahmed all is well now.
WP-ME.com says
Glad to hear that.
Anne Gillion says
Thank you so much for your help. Problem occurred after migrating to another hosting company. Your fix worked like a dream.
WP-ME.com says
I’m glad to hear that.
Thanks for your comment.
Nandini says
Hello,
I get the same error.And I found out that my wp-content folder does not contain any uploads folder.So possibly it seems as if I have permissions problem.Please suggest.
WP-ME.com says
Hey Nandini,
Try the solution above, and if it didn’t work, you may need to contact your hosting provider.
Thanks.
Raj says
Hello, I did all the changes you mentioned but still the same. Also there is no Upload section under Settings > Media.
I tried to create it manually through wp-config but no luck, WP Version 4.6.0; Code snippet is as follows –
/** Absolute path to the WordPress directory. */
if ( !defined(‘ABSPATH’) )
define(‘ABSPATH’, dirname(__FILE__) . ‘/’);
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . ‘wp-settings.php’);
define( ‘UPLOADS’, ‘wp-content/uploads’ );
// Setting up Upload Path 9.02.2017
Host is on Godaddy, Windows
WP-ME.com says
Try to check folder permissions and I think you need to contact your host support team.
Gaurav says
Change Uploads Folder permissions to 777 and you are done. Thanks!
WP-ME.com says
Thanks fr your comment and glad you could fix it. But you need to consider the security issues with 777 file permission.
Sidharth Jain says
Ahmed Elgameel,
Thanks so much. Finally i fixed it my issue.
WP-ME.com says
Glad I could help.
Mike says
THIS DID IT!!!!!! After hours on Youtube videos this actually did it! Thanks!!!
WP-ME.com says
Glad to hear that.
Thanks for stopping by!
Hippo says
sir. i can’t fix it still error, please help me T-T
WP-ME.com says
Please, provide more info.
Hippo says
when i will change permission 777 or 755 then ok botton
have popup -> transfer log -No errors found.
so can’t change sir.
thank you
WP-ME.com says
Did you try all other ways instead of changing permissions?
Hippo says
yes sir,
1.in my menu setting -> media-> not have( Store uploads in this folder)
2. in “wp-config.php” too’.
T-T
WP-ME.com says
Well, I believe you need to contact your hosting provider and ask them about the problem they might have changed something with your account.
Hippo says
thank you sir. i will contact.
@^-^@ thank you for your help sir.
WP-ME.com says
I hope they can fix the problem
Thanks for your comment.
Sarfraz Khan says
Thanks man it solved my problem. It too happened when I migrated my site from godaddy to siteground.
WP-ME.com says
Glad it helped you.
Amanpreet singh says
hlo sir please help i still have this error [Unable to create directory wp-content/uploads/2016/12. Is its parent directory writable by the server?] please solve thanks.
WP-ME.com says
Hey Amanpreet,
Please provide more info on the error, also take a look at comments below as I think you’ll find a way to fix the error.
Thanks!
Abdul says
Just tried to make some design changes and ran into the same problem. I followed the steps did everything but then I got a new error saying “The uploaded file could not be moved to wp-content/uploads/2016/12.”
Please Advice
Thank you
WP-ME.com says
The reason for this problem may be one of these:
NOTE: DO NOT set it to 777.
Also I suggest that you contact your hosting provider to fix this issue.
Thanks for your comment.
Abdul says
Thank you. I would give it a go and see what happens
Andrew says
Thank you Ahmed for giving so much of your time to help others. I too have had hours of grief using WordPress for the first time (15 years out our IT). 4.7 is the version I loaded onto the server (hosted by zanyspace.com) as a .tar.gz. through the webshell, then decomp into a folder off the root (‘/wordpress’) went through the process of adding in details – server, dbase, UN&PW etc and it installed no prob and I’m signed it :-). However as I start designing, I too found I could not upload any pics and got the same error relating to this blog.
Permission were then set 777 recursively from ‘/wordpress’ [parent folder] off the root, still no luck, so set them back to 775.
I followed the instructions to modify wp-config.php, again with no luck. I then recursively changed permissions to 777 again and voila we have communication!! I can not leave the permissions openly set like this as you would appreciate. Do you have a way the server will see WordPress as either ‘Owner’ or ‘Group’ instead of ‘Other’?
The config on the server seems to have all the correct settings (+ your mod through Textpad).
I have even added an ftp sub-account in the cPannel with the same UN&PW as the mySQL db thinkging it my be a ftp issue but no luck there. The only way for WordPress to allow uploads is with 777 or 007 set from /wp-content on wards and I can’t leave it like this, it’s vulnerable.
WP-ME.com says
Thanks for your comment Andrew,
I think you need to contact your hosting support team to fix this problem.
They should figure out where the problem is and set the correct permissions.
If you need any further assistance, don’t hesitate to drop me a line here!
Raji Rasheed says
Thanks it worked .
WP-ME.com says
Glad it could help you.
Suresh says
Thank you so much dear. You saved time
WP-ME.com says
Thanks for stopping by.
Feri says
Hi, I just connect My web host to WP but Im having this problem too, I did the things you mentioned but nothings shio up in setting/media , could you please help me out ?
WP-ME.com says
Have you tried the second solution and added the codes to your “wp-config.php” file manually?
You can also try to change permissions of “wp-content” folder to 755.
ADITYA says
i TRIED BOTH THE THINGS. STILL NO SOLUTION.
WP-ME.com says
Hey Aditya,
Please provide more info on what exactly the error you get so that I can help you more.
Will says
Thank YOU! Saved the day on our website.
WP-ME.com says
Glad to hear that!
Fabian says
Thanks for the detailed answer!! Was of great help on fixing this issue 🙂 Regards,
WP-ME.com says
Glad to hear that.
Sarah says
THANK YOU!!!
WP-ME.com says
Thanks for your comment.
Nick says
Hi, i’ve tried everything you said, and it still doesn’t work.
I can’t see the folder in Settings > Media, even after adding the line to the wp_config.
I’ve tried the 777 method, but that also didn’t work.
WP-ME.com says
Are you using a Localhost or an online host?
If it still not working after changing permissions to 777, change the permissions for the “wp-content/uploads” directory too to 755 or 777.
The cause may also be running PHP in “Safe Mode”. If so, contact your hosting provider to change the owner of scripts and upload directories to belong to your account or ask him to disable Safe Mode.
And let me know if it still not working.
Nick says
Thanks for your response!
I’m using a online host (a server from my school)
The map “wp-content/uploads” does not exist in my FTP server. I’ve tried creating it manually, but then wordpress returns this error : ‘The uploaded file could not be moved to wp-content/uploads/2016/10.’
Also, letting wordpress install a theme on my site doesn’t work, i keep getting an error, even though i know for sure the information is correct. : http://imgur.com/a/EadwE
As for the PHP safe mode, i’m not sure how i can check that? I can’t contact teachers at this time since it’s vacation.
WP-ME.com says
The problem is with your FTP account, From the screenshot you can easily understand that WordPress can’t connect to the FTP server, so it can’t create any new Directory or file or edit any old one.
I think you need to contact your teachers or your school’s system administrator and ask him to solve the problem with the FTP server.
Reagan says
Hello Ahmed, I am using a Localhost on xampp on a mac. I tried to do exactly what you wrote, but when i edit the wp-config file i get another error:
Parse error: syntax error, unexpected ‘require_once’ (T_REQUIRE_ONCE) in /Applications/XAMPP/xamppfiles/htdocs/nish/wp-config.php on line 91
Kindly assist.
Regards.
WP-ME.com says
Hey Reagen!
The error that you get is mainly because you didn’t edit the wp-config.php file correctly, so try to fix this issue or paste the content of the file and I’ll don my best to solve this issue.
For the “Unable to Create Directory wp-content/uploads. Is its Parent Directory Writable by the Server” error, I think you need to provide more information about what exactly you did? as I mentioned many ways in the article and in comments. For now, you can try checking your Mac user account permissions, as sometimes your account don’t have permissions to edit some folders and those folder may include the Xampp folders.
So either change permissions to 755 or 777 or give your user account full control over the folder.
guest says
Thanks so much for this article! It was very helpful!
WP-ME.com says
Thanks for stopping by.
Brad Hamilton says
MR. Elgameel,
I am also having this problem. When I try and upload a theme I get the following error:
The uploaded file could not be moved to wp-content/uploads
When I try to upload a picture to post in a blog entry I receive the same error.
I have added the code:
/**added as per wp-me .com suggestion*/
define(‘UPLOADS’, ‘wp-content/uploads’ );
to my wp-config file.
I have permissions setting of 755 on folder “uploads” and it is owned by nobody,nogroups.
I have unchecked the box asking if i want to keep it in a month and day folder.
I have bounced apache and I am at a loss. I have several plugins and a theme to install before going live with this thing.
Can you be of assistance sir?
Kind Regards,
Brad Hamilton
WP-ME.com says
First of all, check the box that asks you to keep it in month and day folder.
Also have you added the code before the other line I mentioned?
Are you using a localhost? or a web hosting account?
waiting to hear from you, and if I couldn’t help you here I can connect with you on Facebook for further assistance!
Thanks for your comment.
Kim says
I was looking for this because I have this issue as well. But when I checked the Media Settings I have thumbnail sizes and Organize my uploads into month- and year-based folders. > “Store uploads in this folder field enter: wp-content/uploads and click Save changes” isn’t there. No place to add it. I have no way to fix it going about the using this simple answer. I am not sure about the other options I see in comments about other ways to work around this.
WP-ME.com says
Hey Kim,
If you don’t find the field you can add the following code in your “wp-config.php” file:
[php]define( ‘UPLOADS’, ‘wp-content/uploads’ );[/php]
but, make sure to add the code before this line:
[php] require_once(ABSPATH . ‘wp-settings.php’);[/php]
And it should work.
Kim says
I have no clue where that file would be. In the theme or where? I can’t find it. I check in Editor of the theme and it’s not there. I Google it and found this https://codex.wordpress.org/Editing_wp-config.php Which isn’t helpful, just told me where you find the file. 🙁
If its in WordPress itself and my issue is in a blog , what can be done? 🙁 I have 2 blogs that have this issue.
WP-ME.com says
The file is in the main directory of WordPress.
See this: https://imgur.com/EaEwnB7
Just open it with any text editor like Notepad or Notepad++ (Preferred) then click CTRL+F and search for this line:
[php] require_once(ABSPATH . ‘wp-settings.php’);[/php]
and add this code before it:
[php]define( ‘UPLOADS’, ‘wp-content/uploads’ );[/php]
If you couldn’t do this, send your wp-config.php file to me and I’ll edit it for you.
But It contains sensitive data like you WordPress database username and password.
Thanks!
Chandan giri says
I have did as this is but i found again error message like “The uploaded file could not be moved to wp-contentuploads.” please solve the problem. I am working on my website on local serve with xammp
WP-ME.com says
Its “wp-content/uploads” not “wp-contentuploads”.
che says
i dont have Store uploads in this folder in my media settings?
WP-ME.com says
If you don’t have the option to change the uploads folder in your media settings page, you’ll need to change it manually.
Open your “wp-config.php” file with any code editor and add this code to it:
[php]define( ‘UPLOADS’, ‘wp-content/’.’uploads’ );[/php]
Ragnorok says
I did exactly the code.
but still it’s showing the error!!
WP-ME.com says
Delete the previous code, and use this code:
define( 'UPLOADS', 'wp-content/uploads' );
and make sure to add it above this line:
require_once(ABSPATH . 'wp-settings.php');
Ragnorok says
IT WORKEDDD!! 🙂
Added the ‘require_once……’ and ‘defin (..);’ but it still didn’t work.
Then changed the permission of [wp-content to 777] and it worked.
Thank you very much, this is my first web site usinf wordpress plus using LAMP stack.
You rock…XD
WP-ME.com says
Glad I could help you.
If you have any problem don’t hesitate to contact us!
gsp says
Hello Ragnorok, Am facing the same problem i want to know how u changed the permission of wp-content to 777 because my wp-content folder contains 2 folders(plugin folder and theme folder) and index.php but index.php has no code in it.
I have tried all d other answers as sugested by Ahmed but i still get the same error.
WP-ME.com says
Hi gsp,
To change the folder permissions,
1. connect to your website FTP server using FileZilla or any other FTP software.
2. Select the file or folder you want and right-click on it, then click on “File permissions” and enter the permission you want and right click on the folder click OK.
That’s all!
gsp says
thank u Ahmed for the quick response,
For my case i installed wordpress on local site (using Xammp).but i get this error whenever install a theme or an media image
(Unable to create directory wp-content/uploads/2016/09. Is its parent directory writable by the server?)
WP-ME.com says
Try this,
In your Windows Explorer, go to the folder you want and right-click it, then go to “Properties” » then go to “Security” tap, and change the permissions for the current user to “Full control”.
Let me know if it worked!
gsp says
thank you Ahamed, i fix it by Right clicking on all the folders and changing the sharing and permission settings to “write and Read”
WP-ME.com says
Glad to hear that.
Anthony Sharot says
Enabling FastCGI worked for me. If you’ve tried everything else and nothing works then the problem may be due to WordPress (or similar) itself (ie. the User rather than the target folder) not having access rights. FastCGI (or similar) bridges the gap. Ref: https://docs.plesk.com/en-US/12.5/administrator-guide/web-hosting/php-management/php-handler-types.75145/
Juneed sheriff says
It Works for me after changing the Permission of wp-content to 777 thank you Ahmed Elgameel & Ragnorok
WP-ME.com says
Glad to hear that!
Thanks for your comment Juneed.
Ragnorok says
my exact error is
Unable to create directory wp-content//2016/09. Is its parent directory writable by the server?
but still i have ‘uploads Dir’.
WP-ME.com says
The problem appears to be with the two // in the path “wp-content//2016/09”. Is this error before or after adding the code I gave you?
Jagat says
Hi,
Thanks for sharing the solution, I have fixed my uploading issue with the help of your suggestion.
Bagus says
Simple and very helpful.. thank’s
WP-ME.com says
Glad I could help you!
Benjamin says
Hi Ahmed, I read with attention this whole discussion but couldn’t find the answer to my problem I am working on my localhost… and I can’t change the permission… it doesn’t appear when I right click on it… any other ways to do it ? Thanks a lot.
WP-ME.com says
Hi Benjamin and sorry for the late reply,
You can change permissions on localserver by going to the folder you want » Right click on it » Properties » Security » and change the permissions for the current user to “Full control”.