Unable to create directory in wp-content/uploads i

2019-03-01 11:57发布

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.

14条回答
够拽才男人
2楼-- · 2019-03-01 12:52

This solution worked for me:

chown -R www-data:www-data /path-to-mywordpress-root-folde
查看更多
兄弟一词,经得起流年.
3楼-- · 2019-03-01 12:56

Go to 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.

查看更多
走好不送
4楼-- · 2019-03-01 12:57

Change permissions on the /wp-content directory to 0775 and try it again.

sudo chmod 0775 {yourpath}/wp-content/uploads

If it fails, change the permissions to 0777 and try again.

sudo chmod 0777 {yourpath}/wp-content/uploads

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

查看更多
我只想做你的唯一
5楼-- · 2019-03-01 12:58

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.

/home/<base_folder_name>/public_html/wp-content/uploads

For me the <base_folder_name> was different than what was in the hosting account.

查看更多
劫难
6楼-- · 2019-03-01 12:59

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!

查看更多
对你真心纯属浪费
7楼-- · 2019-03-01 13:00

Try following. Make sure {yourpath} is replaced with correct path

Creates upload directory with super user permission

sudo mkdir -p /var/www/{yourpath}/wp-content/uploads

Change ownership to the current user

sudo chown -R $USER:$USER /var/www/{yourpath}/wp-content/uploads
查看更多
登录 后发表回答