本地主机上的wordpress不允许我安装插件
11 个回答
- 投票数
-
-
这会降低安全性吗?我读到Apache不应该拥有任何东西,但这可能只是某人的意见.Does this decrease security? I read that Apache shouldn't own anything, but that may just be someone's opinion.
- 0
- 2014-06-18
- JFA
-
`chown:无效的组:'nobody:nobody'`chown: invalid group: ‘nobody:nobody’`
- 3
- 2017-09-06
- DaVince
-
好吧,上面的注释是正确的,nobody:nobody的想法可能来自/etc/passwd中的条目,nobody:nobody.我质疑谁应该拥有各种文件这一更大的问题,目前正在调查上传Wordpress主题的问题,关于文件所有权的信息存在很多冲突.因此,除非mike23可以给出令人信服的论点并链接到某些参考资料,如[[提供链接内容]](https://stackoverflow.com/help/how-to-answer)Well, this comment above is correct, the idea of nobody:nobody probably comes from the entry in /etc/passwd, nobody:nobody. I question the bigger issue of who should own various files, am currently looking into that for uploading Wordpress themes and there's a lot of conflicting info about file ownership. So this is not really a "correct" answer unless mike23 can give a convincing argument and link to some reference material as in, ["Provide content for links"](https://stackoverflow.com/help/how-to-answer)
- 0
- 2019-06-07
- JimLohse
-
对于Asaf或通过Googling到达此处的任何人,请查看https://wordpress.org/support/article/hardening-wordpress/,拥有最锁定的权限,并决定您是否愿意对上载目录打开权限.For Asaf or anyone who got here by Googling, check https://wordpress.org/support/article/hardening-wordpress/, have the most locked down permissions and decide if you're willing to open up perms on upload dirs.
- 0
- 2019-06-07
- JimLohse
-
-
- 2013-02-27
我发现在运行内置Apache2的Mac上可以使用的解决方案是将其添加到" wp-config.php"
define('FS_METHOD','direct');
将其保留在localhost或开发人员设置中,请勿将其用于生产.
The solution I found that worked on my Mac running the built-in Apache2 was to add this to 'wp-config.php'
define('FS_METHOD','direct');
Keep this to a localhost or dev setup and don't use it for production.
-
这是最好的解决方案.*请确保*不要将其添加到生产中,因为它可能导致安全问题:http://codex.wordpress.org/Editing_wp-config.phpThis is the best solution. *Make sure* you don't add it to production as it can cause security issues: http://codex.wordpress.org/Editing_wp-config.php
- 4
- 2014-03-10
- Justin
-
这是最佳答案(对于WP的本地配置)This is the best answer (for local config of WP)
- 2
- 2015-09-03
- oyvindhauge
-
也可以在Ubuntu 15.10中使用.works in Ubuntu 15.10 too..
- 2
- 2015-11-28
- arshad
-
这在Debian 8中有效this works in Debian 8
- 1
- 2016-01-01
- Vinícius Fagundes
-
毫无疑问,这是本地WordPress的答案.This is the answer without a doubt, for a local WordPress.
- 0
- 2018-09-07
- Dammeul
-
试试这个代替https://stackoverflow.com/questions/18352682/correct-file-permissions-for-wordpressTry this instead https://stackoverflow.com/questions/18352682/correct-file-permissions-for-wordpress
- 0
- 2019-06-07
- JimLohse
-
-
- 2019-05-08
在Debian 9 Stretch上安装WordPress 5之后,我更新了(远程在本地主机上),并提示输入FTP详细信息.
在终端中运行以下命令可解决此问题:
chown -R www-data:www-data /var/www/html chmod -R g+rwX /var/www/html
这是文件所有权问题.
代码和警告 turnkeyLinux.com :
更改文件权限是一个折衷方案 (通常,提高安全性会降低用户友好度和/或 可用性).为了安全起见,"最佳做法"仅是需要以下条件的文件夹 网络服务器的写访问权应归网络服务器所有. 如果您的Web服务器到处都有写访问权限,并且您的服务器 遭到入侵,可以更轻松地破解您的WordPress安装),但 为了便于使用,赋予网络服务器所有权应解决您的所有问题 问题...
After installing WordPress 5 on Debian 9 Stretch I updated (remotely on localhost) and was prompted for FTP details.
Running these commands in terminal fixed the problem:
chown -R www-data:www-data /var/www/html chmod -R g+rwX /var/www/html
It's a file-ownership issue.
Code and caveat from turnkeyLinux.com:
Changing file permissions is a trade off (often increasing security reduces user-friendliness and/or usability). For security 'best practice' only the folders that require write access by the webserver should be owned by the webserver. If your webserver has write access everywhere and your server is compromised it makes it easier to hack your WordPress install) but for ease of use giving the webserver ownership should resolve all your issues...
-
- 2019-05-08
这是一个权限问题.以下是一些以更安全的方式修复所有权和读写权限的步骤:
//检查您的用户名属于哪个组
$组
//如果您的用户名不属于 www-data ,则将用户名添加到组中
$ sudo usermod -a -G www-data用户名
//退出ssh会话(或关闭终端窗口,如果是本地的话)以更改组更改
$退出
//现在赋予/var/www/html 的 www-data 组所有权(您无需修改所有者,只需在此处更改组所有权)>
$ sudo chgrp -R www-data/var/www/html
///为www-data成员的用户提供必要的r/w权限目录和文件
$ sudofind/var/www/html -type d -exec chmodg=rwxs" {}" \;
$ sudofind/var/www/html -typef -exec chmodg=rw" {}" \;
//我想先检查一下事情
$ ls -l/var/www/html/
//您可能不需要重新启动apache,但是如果您想
$ sudo服务apache2重新启动
Apache现在应该具有对
/var/www/html
的读/写访问权限,以及您与shh/ftp一起使用的也属于www-data
This is a permissions issue. Here are some steps to fix ownership and r/w permissions in a more secure way:
// check what groups your username belongs to
$ groups
// if your username doesn't belong to www-data then add username to group
$ sudo usermod -a -G www-data username
// exit ssh session (or close terminal window if local) to make group change stick
$ exit
// now give www-data group ownership of /var/www/html (you're not modifying the owner, just changing group ownership here)
$ sudo chgrp -R www-data /var/www/html
// give necessary r/w permissions directories and files to users who are members of www-data
$ sudo find /var/www/html -type d -exec chmod g=rwxs "{}" \;
$ sudo find /var/www/html -type f -exec chmod g=rw "{}" \;
// I like to check things before moving on
$ ls -l /var/www/html/
// you likely don't need to restart apache, but if you want to
$ sudo service apache2 restart
Apache should now have r/w access to
/var/www/html
as well as any user that you shh/ftp in with that also belongs towww-data
-
- 2016-06-17
Ubuntu用户
只需将
define('FS_METHOD','direct');
添加到wp-config.php,它将在localhost上运行.只要确保您没有将其添加到生产版本即可.请参阅: codex.wordpress.org/Editing_wp-config.phpUbuntu Users
Just add
define('FS_METHOD','direct');
to wp-config.php and it will work on localhost. Just make sure you don't add it to production version. See: codex.wordpress.org/Editing_wp-config.php-
这不是特定于Ubuntu的.This isn't specific to Ubuntu..
- 1
- 2016-06-17
- Tim Malone
-
- 2016-07-21
我通常使用:
sudo chown -R _www:_www/path/to/wordpress/
如果安全性不是大问题
I usualy use :
sudo chown -R _www:_www /path/to/wordpress/
if security not big issue
-
这有效,但是如果我这样做,则意味着我无法通过finder在该文件夹中执行任何操作.从来没有过这些问题,奇怪的是今年开始.This works but if i do that it means i can't do anything in that folder via finder. Never used to have these issues and odd its started this year.
- 0
- 2018-05-16
- v3nt
-
如果安全性不是大问题,但是您不想为连接到互联网的任何内容打开这样的所有wordpress文件,那就很好了:)This is fine if security is not a big issue but you don't want to open up all your wordpress files like this for anything connected to the internet :)
- 0
- 2019-06-07
- JimLohse
-
- 2011-06-10
这不是WordPress问题.您需要参考LAMP服务器的文档以检查设置选项.
对于localhost,您可以绕过WordPress的插件安装,而只需将插件复制到/wp-content/plugins中.将它们复制到后,转到WordPress管理,它们将显示在准备激活的插件中.
确保解压缩插件并将其保留在文件夹中.
This isn't a WordPress problem. You need to refer to the documentation for the LAMP server to check the setup options.
For localhost, you can bypass plugin installation from WordPress and simply copy your plugins into /wp-content/plugins. After you copy them in, go to your WordPress administration and they will show up in your plugins ready to be activated.
Make sure you unzip the plugins and keep them in their folders.
-
- 2015-09-15
您需要做两件事
-
添加WolfieZero所说的
define('FS_METHOD','direct'); 在wp-config.php文件中
这时您将获得以下内容,向前迈出了一步
打开包的包装...无法创建目录.
2
Then set permission to 777 to wp-content/plugins
此后,它将显示如下消息
Downloading install package from https://downloads.wordpress.org/theme/exclusive.1.0.32.zip… Unpacking the package… Installing the theme… Successfully installed the theme Exclusive 1.0.32.
CHOWN也应该起作用,并且将Server置于所有者组中是一种更好的方法.
You need two things to do
Add WolfieZero has said
define('FS_METHOD','direct'); in wp-config.php file
At this point you will have following, which one step forward
Unpacking the package…Could not create directory.
2
Then set permission to 777 to wp-content/plugins
After this it will show message like following
Downloading install package from https://downloads.wordpress.org/theme/exclusive.1.0.32.zip… Unpacking the package… Installing the theme… Successfully installed the theme Exclusive 1.0.32.
CHOWN should also work and it is better way of doing it that Server is in owner group.
-
- 2011-06-10
-
- 2016-06-20
我不知道您是否回答...但是我遇到的问题,特别是在我使用linux时,我只是想也许其他用户,尤其是在linux上工作的用户可能会发现这很有用.我面临着同样的问题...但是我不得不使用SSH2选项.
如何安装SSH2
apt-get install openssh-server libssh2-php
在那之后,我不得不重启我的apache2服务器.
然后,当我尝试上传主题时,在要求输入凭据时必须使用SSH而不是FTP.
例如
Hostname: localhost FTP/SSH Username: admin FTP/SSH Password: password
它奏效了.
谢谢.
I don't know if you are answered...but what i have encountered especially when i was working on linux and i just thought maybe other users, especially who are working on linux might find this useful. I was facing the same problem...but i had to use the SSH2 option.
How to install SSH2
apt-get install openssh-server libssh2-php
After that, i had to restart my apache2 server.
Then when i tried to upload my theme i had to use SSH not FTP when asked for credentials.
E.g
Hostname: localhost FTP/SSH Username: admin FTP/SSH Password: password
And it worked.
Thanks.
我在ubunutu 11.04上安装了LAMP服务器. 我已经安装了wordpress并将其与MySQL数据库挂钩. 我已经更改了www-data组的权限以读取和写入文件.
每件事似乎都可以使用,我可以通过管理面板管理站点,但是我无法安装插件,因为系统询问我FTP详细信息,而我似乎无法通过.
身体可以帮助吗?请...