我如何知道 Wordpress 使用哪个 linux 用户来安装插件 [英] How do I know which linux user Wordpress uses for plugin installation

查看:28
本文介绍了我如何知道 Wordpress 使用哪个 linux 用户来安装插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Wordpress 设置为能够通过 SFTP (SSH) 在 Centos 6 VPS 上安装插件.

I'm trying to setup Wordpress to be able to install plugins via SFTP (SSH) on a Centos 6 VPS.

我已经能够修改 wp-config,使其使用正确的凭据,user 作为我的 SFTP 用户.

I've been able to modify wp-config so it uses the right credentials with user as my SFTP user.

现在我遇到了与权限相关的问题,就好像我在我能够安装的 wp-content 文件夹上执行了一个 chmod 777,但具有正常权限它不能创建文件夹.

Now I have a permission related problem, as if I do a chmod 777 on my wp-content folder I'm able to install, but with the normal permissions it can't create folders.

我正在使用 Nginx,我的所有 wp-content 文件和文件夹都归 user 所有,我尝试将组设置为 nginx 但它不起作用.

I'm using Nginx and all my wp-content files and folders are owned by user and I've tried setting the group to nginx but it doesn't work.

我也尝试将用户设置为 nginx 但仍然没有成功.

I also tried setting the user as nginx but still no luck.

更新:我发现 wordpress 正在使用 apache 作为用户,但我想将其更改为我的 user .我该怎么做?

UPDATE : I found out wordpress was using apache as user but I want to change this to my user instead. How can I do this ?

推荐答案

在您的生产服务器上,在您的 WordPress index.php 文件的顶部,您可以临时放置 echo(exec("whoami"));die();

On your production server, in your WordPress index.php file, at the top, you can temporarily put echo(exec("whoami"));die();

然后浏览到您的 WordPress 站点并查看正在运行的用户.在 Ubuntu 上,我的是 www-data.

Then browse to your WordPress site and see what user was running. On Ubuntu, mine was www-data.

这对我很有用:我可以在不提供 FTP 访问的情况下安装/更新 WordPress 插件?

这篇关于我如何知道 Wordpress 使用哪个 linux 用户来安装插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆