简体   繁体   English

无法在 linux 服务器中更新 Wordpress 主题和插件(文件权限问题)

[英]Cannot update Wordpress theme and plugins (file permission issues) in linux server

The update cannot be installed because we will be unable to copy some files.无法安装更新,因为我们将无法复制某些文件。 This is usually due to inconsistent file permissions.这通常是由于文件权限不一致。

When trying to update plugins from the admin interface.尝试从管理界面更新插件时。 I've set the user to www-data for both directories and files … but nothing works.我已将用户设置为目录和文件的 www-data ......但没有任何效果。

What do I have to do to simply being able to use Wordpress as it is intended?我该怎么做才能按预期使用 Wordpress?

This issue is usually caused by incorrect file permissions or ownerships on your server (rather than being a problem with the plugin itself).此问题通常是由服务器上不正确的文件权限或所有权引起的(而不是插件本身的问题)。 Basically, WordPress isn't able to properly access its own plugins folder, and as a result, can't put the updated plugins files in there.基本上,WordPress 无法正确访问自己的插件文件夹,因此无法将更新的插件文件放在那里。

Permissions权限

Permissions can be set to 644 for files and 755 for folders.文件的权限可以设置为 644,文件夹的权限可以设置为 755。 To do so, you can run two quick find commands.为此,您可以运行两个快速查找命令。

To make all folders in your website path with 755 permissions run the following command要使您的网站路径中的所有文件夹具有 755 权限,请运行以下命令

find /path/to/your_website -type d -exec chmod 755 {} \;

To make all files in your website root directory with 644 permissions, you can run要使您网站根目录中的所有文件具有 644 权限,您可以运行

find /path/to/your_website -type f -exec chmod 644 {} \;

Please make sure to change /path/to/your_website with your real path.请确保将 /path/to/your_website 更改为您的真实路径。

Ownership所有权

Ownership means which user and group are controlling the files.所有权意味着哪个用户和组正在控制文件。 Usually, that's www-data.通常,这是www-data。 So what you'll need to do si所以你需要做什么

sudo chown -R www-data:www-data /path/to/your_website

Please make sure to change /path/to/your_website with your real path.请确保将 /path/to/your_website 更改为您的真实路径。

Once you do it, that's it, you are good to go.一旦你这样做了,就是这样,你对 go 很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM