カテゴリー
WordPress

wp-content ディレクトリが見つかりません

WordPress 3.3.1で

wp-content ディレクトリが見つかりません。 (日本語版)
Unable to locate WordPress Content directory (wp-content). (英語版)

というエラーメッセージがプラグインの更新で出るようになりました。以前はエラーは出てなかったのですが、最近バージョン 3.3.1にアップグレードして以降こうなったような気がします。

調べてみたところ、一番簡単な解決方法は ./wp-config.php に

define ('FS_METHOD', 'direct');

を追加することと、./wp-content ディレクトリ以下をapacheのユーザー権限に変更してしまうことでした。

# chown -R www wp-content

これでアップデートの際にftp/sftpの情報なしに直接アップデートしてくれるようになりました。

参考URL:
WordPress Upgrade Constants
http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants

  • FS_METHOD forces the filesystem method. It should only be “direct”, “ssh2”, “ftpext”, or “ftpsockets”. Generally, You should only change this if you are experiencing update problems, If you change it, and it doesnt help change it back/remove it, Under most circumstances, setting it to ‘ftpsockets’ will work if the automatically chosen method does not.
    • (Primary Preference) “direct” forces it to use Direct File I/O requests from within PHP, this is fraught with opening up security issues on poorly configured hosts, This is chosen automatically when appropriate.
    • (Secondary Preference) “ssh2” is to force the usage of the SSH PHP Extension if installed
    • (3rd Preference) “ftpext” is to force the usage of the FTP PHP Extension for FTP Access, and finally
    • (4th Preference) “ftpsockets” utilises the PHP Sockets Class for FTP Access.