Is its parent directory writable by the server I read articles here with the same problem but the codes to fix Hi, I installed a clean version of WordPress and I was uploading a theme and it says: Unable to create directory wp-content/uploads/2016/07.
I am not able to upload any images to the Media section.I get this error message:
'Unable to create directory wp-content/uploads/2015/05. Is its parent directory writable by the server?'
I tried changing the permissions, gave full access 777 to both uploads, and wp-content directory but this didn't help.
I tried changing the owners to apache : apache for /wordpress/wp-content, but that hasn't helped either.
upload_path is set to wp-content/uploads in option-media.php. Still it is not working.
Tried defining upload path
define(UPLOADS, 'wp-content/uploads');
No Help.(server: centos)
Someone, please help!!!
-Thanks in advance.
Aasim Hussain Khan
Aasim Hussain KhanAasim Hussain Khan
15 Answers
user4796874
I was having a similar problem after migrating from a development site to a production site. It turned out that the message is deceptive. Check Settings, Media. Verify the directory for media is accurate for the current site. If the site was migrated, the directory listed still be from the old site and may need to be updated.
MRMorrellMRMorrell
Change permissions on the /wp-content directory to 0775 and try it again.
If it fails, change the permissions to 0777 and try again.
Once it is successful, be sure to return the permissions on /wp-content to whatever they were when you started.
You may also want to put the permissions back on any other files you changed while attempting to resolve the issue.
More options you can find here: https://www.tipsandtricks-hq.com/how-to-fix-the-unable-to-create-directory-error-in-wordpress-5264
Reggards
AndaramisAndaramis
If this error is showed after migrating wordpress to new server check upload path in:settings->media->Store uploads in this folder
default value is wp-content/uploads.
Probably you have old path.
sasasasa
Go to
Under
That worked for me after I had tried to all other solutions for days.
wp-admin/options.php
Under
upload_path
replace with exactly wp-content/uploads
(no quotes, no extra slashes)That worked for me after I had tried to all other solutions for days.
tussa33tussa33
I have managed to solve this by updating the reference to Settings Media Store uploads folder.
Go to WordPress admin -> Settings -> Media, and update
Store uploads in this folder
option with what is in your public_html
hosting account. For me the
<base_folder_name>
was different than what was in the hosting account.zfdzfd
![Unable to create directory uploads/2019/05. is its parent directory writable by the server? Unable to create directory uploads/2019/05. is its parent directory writable by the server?](/uploads/1/2/4/7/124725192/325126256.jpg)
'The uploaded file could not be moved to wp-content/uploads/2015/05.'
This error comes because of insufficient permission to your user on to the server.
One Quick and dirty way to solve this error is to set 777 permission but some time it may not also work.
Follow this link this will help youhttp://2surge.com/how-to-fix-the-uploaded-file-could-not-be-moved-to-wp-content-error-message/
Thanks
rajatsaurastrirajatsaurastri
I tried all the solutions from How to Fix the Unable to create directory Error in WordPress in my Centos7. But it won't work.
Then I found some useful message in /var/log/audit/audit.log
type=AVC msg=audit(1495357844.782:604): avc: denied { write } for pid=2721 comm='httpd' name='wp-content' dev='dm-5' ino=1074299184 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:etc_runtime_t:s0 tclass=dir type=SYSCALL msg=audit(1495357844.782:604): arch=c000003e syscall=83 success=no exit=-13 a0=7fffba9c62c0 a1=1ff a2=8 a3=5 items=0 ppid=1556 pid=2721 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm='httpd' exe='/usr/sbin/httpd' subj=system_u:system_r:httpd_t:s0 key=(null)
Check the file infomation :
ls -Z /data/web/wordpress
Found that SELinux prevented Httpd to access the files. So you can disable the SELinux, or modify the file context: chcon -R --type=httpd_sys_rw_content_t /data/web/wordpress . And it works.
RyanLeiRyanLei
Try following. Make sure {yourpath} is replaced with correct path
Creates upload directory with super user permission
Change ownership to the current user
RuwanthaRuwantha
I had the same problem here on a Parallels Plesk server. I had to change the access permissions for the webserver/website user using the access options from within the file manager.
Hope this helps!
MatMat
Elias MissaouiElias Missaoui
This is sometimes an issue with file and directory ownership than permissions. Find out the user the php code is executing as using
phpinfo()
page.Once you know the system user, make sure the FTP account you are using is configured to upload the files as that user. If it has been uploaded using different user, use
chown
to change the ownership of the base path to match the user.For example:
Dilip Raj BaralDilip Raj Baral
This is a solution when you are on your local but can be applied also on a server.
Sometimes if you get a backup from the database that is on a server and you recover it on your local you will have this problem: 'Unable to create directory...' even if you have the correct permissions on your folder.This happens because WP points to a value on upload_path on the database.
So go to wp_options table.
Search for upload_path and check if the path is correct.
If not. (on mac and unix) Go to your upload folder, drag it to the terminal. And use pwd command copy the response on upload_path on the database.
Hopefully this will help someone.
![Parent Parent](http://farm8.staticflickr.com/7240/6884098316_39f9e71fb2_z.jpg)
perseusperseus
MaoMao
I was looking for a MAC/ OSX solution and found this related question but it didn't help. The following works for me:1- Right-click on
wp-content
and go to Get Info and change permissions as follow:After click on the setting gear icon and Apply to enclosed items....
Maihan NijatMaihan Nijat
Not the answer you're looking for? Browse other questions tagged wordpressfile-uploadpermissionscentosimage-uploading or ask your own question.
If you see one of the following errors relating to the uploads folder:
- Unable to create directory wp-content/uploads/. Is its parent directory writable by the server?
- The uploaded file could not be moved to wp-content/uploads/
This may indicate a permissions problem with your WordPress uploads directory.
If you don’t have shell access to your web server to set up directory permissions, you may need to contact your web host for support.
If you have shell access, check the permissions for the directory WordPress is attempting to write to. You will need to locate your document root, in this example, our document root is
/var/www/html
and the WordPress uploads directory is in /var/www/html/wp-content/uploads/
. If the uploads folder does not exist, create it.Let’s check the permission for the uploads directory.
Above we can see the owner of the directory is
john
, the person who set up the web server.We need to change this to
www-data
. This is the user that owns the Apache/Nginx web server service and will give WordPress the necessary permissions to upload files.Let’s recursively change the owner for our WordPress uploads directory and sub directories to
www-data
. Be sure to change /var/www/html/wp-content/uploads
to your own uploads directory.Now if we check the permissions for the uploads directory again, we should see
www-data
as owner.You should now be able to upload files again in WordPress.
Let me know in the comments if this helped. Follow me on Twitter, Facebook and YouTube.
p.s. I increased my AdSense revenue by 68% using AI ?. Read my Ezoic review to find out how.
5.00 (3 votes)