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:37

Debian like:

chown -R www-data:www-data /var/www/{yourpath}/wp-content/uploads
查看更多
男人必须洒脱
3楼-- · 2019-03-01 12:37

"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 you http://2surge.com/how-to-fix-the-uploaded-file-could-not-be-moved-to-wp-content-error-message/

Thanks

查看更多
Bombasti
4楼-- · 2019-03-01 12:40

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.

查看更多
Juvenile、少年°
5楼-- · 2019-03-01 12:41

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.

查看更多
戒情不戒烟
6楼-- · 2019-03-01 12:45

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:

$ sudo chown -R <user> /path/to/public_html
查看更多
女痞
7楼-- · 2019-03-01 12:49

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:

Changing permission for wp-content folder

After click on the setting gear icon and Apply to enclosed items....

Apply to selected items

查看更多
登录 后发表回答