Unpacking the update… Could not create directory.

2019-03-15 13:20发布

When I instal nextgen-gallery plugins. This error message appears

Downloading update from https://downloads.wordpress.org/plugin/nextgen-gallery.zip…

Unpacking the update…

Could not create directory.

How can I fix this problem ?

10条回答
一夜七次
2楼-- · 2019-03-15 13:46

If you are using vsftpd as your FTP server and have enabled passive connections, you need to add pasv_promiscuous=YES to /etc/vsftpd/vsftpd.conf.

查看更多
趁早两清
3楼-- · 2019-03-15 13:51

All the above is great, but I think you missed the simplest issue. Your website is using more space than it has allotted, and therefore it is broke. Wordpress makes more files as is in use. If you are on the margin of going over, a simple overnight issue where you did nothing is possible. Go to bed, everything fine. In the morning website is broke.

I own my websites so I go into the reseller part of Hostmonster or Hostgator (I have sites on both hosting platforms) and I reallocate more space and the problem goes away usually. Try that first, or look into it before messing around with permissions. If you changed a permission and the issue came up, could be permissions, otherwise, check this first.

查看更多
The star\"
4楼-- · 2019-03-15 13:55

Most likely, if you have configured it correctly, the http server associated to your wordpress site belongs to the group www-data. That's how one should configure it correctly.

Try members www-data and ps aux | grep www-data to be sure. In the latter command you should see on the last columns either nginx or apache.

In this case, you just need to set that group to the directory

sudo chgrp -R www-data <your_wordpress_root_dir>/

and then add full group permissions to such directory

sudo chmod -R g+rwx <your_wordpress_root_dir>/

Now it works perfectly :)

查看更多
Emotional °昔
5楼-- · 2019-03-15 14:06

@skrilled and @knutole's answer was great but I found that when attempting to fix the issue on the plugins folder, everything was ok and the answer did not work for me.

If anyone else has this issue, try looking at the upgrades folder also. This folder (from what I can see) is used as a folder to store temporary files for when WP upgrades or plugin updates are being ran.

If you simply receive the message stating 'Could not create directory' and there is no path specified, it could actually be talking about the upgrades folder.

查看更多
戒情不戒烟
6楼-- · 2019-03-15 14:08

I was having a similar issue. It started with me trying to update a plugin on a migrated WP install. I didn't get it, all my permissions were EXACTLY the same as the old server. In my situation, I started to see that not much was working properly. I couldn't install/delete plugins or themes as well as uploading media would error out. Then I found the fix via some research.

If you are still having this issue, and changing permissions DID NOT fix the problem try this:

Go in to your hosting control panel and find your hosting settings, wherever you can edit your scripting settings. In Plesk (as in my example), this would be under Websites & Domains. Click on your domain name at the bottom. On the next screen, where it says "PHP support (run as..." change the dropdown from "Apache module" over to "FastCGI application". Everything should be fixed up now!

FastCGI

查看更多
做个烂人
7楼-- · 2019-03-15 14:10

This is a permissions issue. Ensure the directory is writable by apache. Plugins are unpacked into the wp-content/plugins directory, so I would first attempt writing to the directory as apache:

sudo -u apache touch /path/to/wp-content/plugins/test.txt

Set permissions accordingly to correct the issue. You can read about permissions here: http://www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions

You can read about the correct file permission scheme for Wordpress here: http://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress

查看更多
登录 后发表回答