【问题标题】:Wordpress Permission nightmare on Centos 7Centos 7 上的 Wordpress 权限噩梦
【发布时间】:2018-09-30 00:51:29
【问题描述】:

我在远程服务器上安装了 wordpress

 /var/www/html/site.com/public_html

使用 AllowOverride All 指向此文件夹的虚拟主机

指点有效。

现在我已将所有文件夹的所有权设置给用户:apache 并将用户包含在 apache 组中

 all folder are setted to 755 
 and file to 644
 wp-config.php to 440
 wp-content to apache and 755

当我尝试下载插件/主题上传照片 ecc 时出现问题。形成界面。

我什至在机器上创建了 sftp 服务器,并在用户文件夹中设置了一个 rsa_key。

然后使用插件 ssh-sftp-updater-support 我启用了 ssh2 但错误提示“无法创建目录”

有人可以帮我解决这个噩梦吗?

【问题讨论】:

    标签: wordpress file-permissions centos7


    【解决方案1】:

    PHP 在哪个用户下运行?如果不是 apache,则无法创建目录,因为它不是所有者(755 权限)。要查看运行 PHP 的用户,请尝试以下代码

    <?php
    system('/usr/bin/id');
    ?>
    

    服务器可以使用mod_ruidsuEXEC来让PHP在不同的用户下运行。

    如果 PHP 确实在 apache 以外的其他设备下运行,则需要更改所有权或将文件夹 chmod 为 777。

    【讨论】:

    • 这是 apache uid=48(apache) gid=48(apache) groups=48(apache) context=system_u:system_r:httpd_t:s0...
    • 这看起来不错。如果将文件夹权限更改为 777 是否有效?如果即使使用 777 也无法正常工作,则可能是 FTP 问题。检查是否允许 sftp 写入文件。设置在/etc/vsftpd.conf文件中,搜索write_enable设置为write_enable=YES
    猜你喜欢
    • 2020-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-21
    • 2010-11-13
    • 2010-12-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多