IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    CentOS 7 安装wordpress 权限问题

    lesca发表于 2014-12-23 08:23:30
    love 0

    如果你的wordpress安装目录是wordpress,则通过默认向导配置会出现权限不足的情况:

    Sorry, but I can’t write the wp-config.php file.
    You can create the wp-config.php manually and paste the following text into it.
    

    或者

    抱歉,但是向导在您的文件系统中没有足够的权限写入wp-config.php文件。
    

    wp_permission

    这时候,首先考虑wordpress文件夹的所属用户和组,根据httpd.conf中User和Group的配置,更新wordpress目录及其子目录的所有归属:

    chown -R apache:apache wordpress/
    

    如果该方法不解决问题,尝试以下命令:

    ls -Z
    drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 wordpress
    
    chcon -R -t httpd_sys_rw_content_t #为httpd添加读写权限
    ls -Z
    drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 wordpress
    

    注意

    该问题通常是由于手动创建wordpress目录后,再将原版中的所有文件复制进去引起的。通过直接拷贝整个wordpress目录也可以解决。



沪ICP备19023445号-2号
友情链接