【问题标题】:wp + not able to install updateswp + 无法安装更新
【发布时间】:2017-09-27 11:09:20
【问题描述】:

我正在尝试更新我的wordpress 站点plugins 和主题,但我无法更新它们。我收到以下消息。

更新 All In One WP Security 时出错:更新 无法安装,因为我们将无法复制某些文件。这 通常是由于文件权限不一致。语言, wp-security.php.....等等插件更新的错误。

我试过的是

  1. 通过以下命令设置文件和文件夹的权限

    find /var/www/html/ -type d -exec chmod 755 {} \;
    
    find /var/www/html/ -type f -exec chmod 644 {} \;
    
    chmod -R 777 /var/www/html//wp-content/cache/autoptimize
    
  2. 运行下面的代码来设置权限

    function AllDirChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){
       $d = new RecursiveDirectoryIterator( $dir );
       foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){
          if( $path->isDir() ) chmod( $path, $dirModes );
          else if( is_file( $path ) ) chmod( $path, $fileModes );
      }
    }
    
  3. 在 wp-config 文件中添加以下代码,因为 wp 在安装或更新任何内容时会询问 FTP 详细信息。

    define('FS_METHOD', 'direct');
    

我的网站在AWS EC2 Ubuntu 16.04 with php7 服务器上。

【问题讨论】:

    标签: php wordpress ubuntu plugins amazon-ec2


    【解决方案1】:

    您可能需要将您的 Web 服务器设置为项目目录的所有者。如果您使用的是 apache,请使用以下命令:

    sudo chown -R apache:apache /var/www/html/
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-02
      • 1970-01-01
      相关资源
      最近更新 更多