php 正在解压缩更新... 无法创建目录。WordPress
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20360396/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unpacking the update... Could not create directory. Wordpress
提问by BigTech
When I instal nextgen-galleryplugins. This error message appears
当我安装nextgen-gallery插件时。出现此错误消息
Downloading update from https://downloads.wordpress.org/plugin/nextgen-gallery.zip…
Unpacking the update…
Could not create directory.
How can I fix this problem ?
我该如何解决这个问题?
回答by skrilled
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:
这是一个权限问题。确保该目录可被 apache 写入。插件被解压到 wp-content/plugins 目录中,所以我会首先尝试以 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
相应地设置权限以更正问题。您可以在此处阅读有关权限的信息:http: //www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions
You can read about the correct file permission scheme for Wordpress here: https://wordpress.org/support/article/changing-file-permissions/
您可以在此处阅读有关 Wordpress 的正确文件权限方案:https: //wordpress.org/support/article/changed-file-permissions/
回答by damienoneill2001
@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.
@skrilled 和@knutole 的回答很棒,但我发现在尝试解决插件文件夹上的问题时,一切正常,但答案对我不起作用。
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.
如果其他人遇到此问题,请尝试查看升级文件夹。此文件夹(从我所见)用作存储临时文件的文件夹,以便在运行 WP 升级或插件更新时使用。
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.
如果您只是收到“无法创建目录”的消息并且没有指定路径,则实际上可能是在谈论升级文件夹。
回答by Hassan Gilak
for nginx people
if you have php-fpm installed you have to tell it that its user and group is nginx. /etc/php-fpm.d/www.conf . find user which is assigned to apache by default and change it to nginx. also do it for group. then run this command :
对于 nginx 用户,
如果你安装了 php-fpm,你必须告诉它它的用户和组是 nginx。/etc/php-fpm.d/www.conf 。找到默认分配给apache的用户并将其更改为nginx。也为团体做。然后运行这个命令:
sudo service php-fpm restart
also inside of your wordpress directory execute these commands
也在你的 wordpress 目录中执行这些命令
sudo chown nginx:nginx * -R
sudo usermod -a -G nginx username
change username into what your current username is.
yet you have to apply propper permissions.
run these commands inside your wordpress directory
将用户名更改为您当前的用户名。
但您必须应用适当的权限。在你的 wordpress 目录中运行这些命令
sudo find . -type f -exec chmod 664 {} +
sudo find . -type d -exec chmod 775 {} +
回答by Jo?o Pimentel Ferreira
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.
最有可能的是,如果您已正确配置它,则与您的 wordpress 站点关联的 http 服务器属于该组www-data。这就是人们应该正确配置它的方式。
Try members www-dataand ps aux | grep www-datato be sure. In the latter command you should see on the last columns either nginxor apache.
尝试members www-data并ps aux | grep www-data确定。在后一个命令中,您应该在最后一列中看到nginx或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 :)
现在它完美运行:)
回答by Meekohi
If you are using vsftpdas your FTP server and have enabled passive connections, you need to add pasv_promiscuous=YESto /etc/vsftpd/vsftpd.conf.
如果您vsftpd用作 FTP 服务器并启用了被动连接,则需要添加pasv_promiscuous=YES到/etc/vsftpd/vsftpd.conf.
回答by Dirk
(Re)setting the permissions via ftp didn't make a difference for me either. There is no SSH available, so I had to log in the control panel (directadmin in my case), the File Manager where I could "Reset Owner" to "File ownership reset" the /wp-contents directory.
(重新)通过 ftp 设置权限对我也没有任何影响。没有可用的 SSH,所以我必须登录控制面板(在我的例子中是直接管理员),我可以在文件管理器中“重置所有者”到“重置文件所有权”/wp-contents 目录。
回答by Andrew Jennings
I'm running Nginx with Wordpress. I deleted the upgrade folder in wp-content and then ran the upgrade from the wordpress GUI again. I noted the linux user for the upgrade folder created was www-data. I then did a {sudo chmod -R www-data:www-data .} Ran the upgrade again from the GUI and it worked.
我正在使用 Wordpress 运行 Nginx。我删除了 wp-content 中的升级文件夹,然后再次从 wordpress GUI 运行升级。我注意到创建的升级文件夹的 linux 用户是 www-data。然后我做了一个 {sudo chmod -R www-data:www-data 。} 再次从 GUI 运行升级并且它起作用了。
Probably need to change the permissions on most of the folders so they can't be modified by www-data but I'll figure that out tomorrow.
可能需要更改大多数文件夹的权限,以便 www-data 无法修改它们,但我明天会弄清楚。
回答by Ce.
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.
我遇到了类似的问题。我开始尝试在迁移的 WP 安装上更新插件。我没明白,我的所有权限都与旧服务器完全相同。在我的情况下,我开始发现没有多少工作正常。我无法安装/删除插件或主题以及上传媒体会出错。然后我通过一些研究找到了修复方法。
If you are still having this issue, and changing permissions DID NOT fix the problem try this:
如果您仍然遇到此问题,并且更改权限未解决问题,请尝试以下操作:
Go in to your hosting control paneland 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!
进入您的主机控制面板并找到您的主机设置,您可以在任何可以编辑脚本设置的位置。在 Plesk(如我的示例中)中,这将位于网站与域名下。在底部单击您的域名。在下一个屏幕上,显示“PHP support (run as...”)将下拉列表从“Apache 模块”更改为“FastCGI 应用程序”。现在应该修复所有内容!


回答by Sanjok Gurung
A permission issue, make sure apache (www-data) has write permissions.
权限问题,请确保 apache (www-data) 具有写入权限。
回答by David Cox
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.
以上所有内容都很棒,但我认为您错过了最简单的问题。您的网站使用的空间超过分配的空间,因此它已损坏。Wordpress 制作更多正在使用的文件。如果您即将过去,那么您什么都不做的简单隔夜问题是可能的。去睡觉,一切都好。早上网站坏了。
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.
我拥有我的网站,所以我进入了 Hostmonster 或 Hostgator 的经销商部分(我在两个托管平台上都有网站),我重新分配了更多空间,问题通常会消失。首先尝试一下,或者在处理权限之前查看它。如果您更改了权限并且出现了问题,则可能是权限问题,否则,请先检查这一点。

