「wp-content ディレクトリが見つかりません。」というエラー
プラグインの自動アップデートを実行しようとしたら標記エラーが表示された。
調べてみると、解決策が見つかった。
「wp-config.php」に以下の3行を追加すると良いらしい。
define(‘FTP_BASE’, ‘/path/to/wordpress/’);
define(‘FTP_CONTENT_DIR’, ‘/path/to/wordpress/wp-content/’);
define(‘FTP_PLUGIN_DIR’, ‘/path/to/wordpress/wp-content/plugins/’);
が、今度は別のエラーが・・・
Warning: touch() [function.touch]: SAFE MODE Restriction in effect. The script whose uid is 10392 is not allowed to access /tmp owned by uid 0 in /…/file.php on line 175
どうやら、以下の内容の「.htaccess 」を wp-admin/ ディレクトリに置けば良いようだ。
<files async-upload.php>
AddHandler application/x-httpd-phpcgi .php
</files>
<Files plugin-install.php>
AddHandler application/x-httpd-phpcgi .php
</Files>
<Files update.php>
AddHandler application/x-httpd-phpcgi .php
</Files>
<Files update-core.php>
AddHandler application/x-httpd-phpcgi .php
</Files>
これで、ファイルアップロード、プラグイン新規インストール、テーマ自動アップグレード、コアアップグレードに対応できた。
