新しい WordPress セットアップでプラグインやテーマを自動的にインストールできません。次の画面が表示されます:
これは通常、WordPress ディレクトリの書き込み権限エラーが原因であると考えられます。これまでに実行した手順は次のとおりです。
nginx は root ユーザーの下で実行され、ワーカー プロセスは nginx ユーザーの下で実行されます。
# ps -ef | grep nginx | head
root 14197 1 0 07:46 ? 00:00:00 nginx: master process nginx
nginx 14198 14197 0 07:46 ? 00:00:00 nginx: worker process
PHP-FPM は root ユーザーの下で実行され、ワーカー プロセスは nginx ユーザーの下で実行されます。
# ps -ef | grep php-fpm | head
root 14748 1 0 08:38 ? 00:00:00 php-fpm: master process (/etc/php-fpm.conf)
nginx 14749 14748 0 08:38 ? 00:00:00 php-fpm: pool www
nginx 14750 14748 0 08:38 ? 00:00:00 php-fpm: pool www
nginx 14751 14748 0 08:38 ? 00:00:00 php-fpm: pool www
nginx 14752 14748 0 08:38 ? 00:00:00 php-fpm: pool www
...
root ユーザーは nginx グループの一部です。
# groups root
root : root nginx
wordpress ディレクトリは nginx:nginx と 777 (どちらも再帰的に) によって所有されています。
# ls -l /var/www/
total 4
drwxrwxrwx. 5 nginx nginx 4096 Feb 24 06:45 wordpress
しかし、どれも問題は解決しません。次に何をチェックすればよいかわかりません。私は CentOS 7 最小限を使用しています。
答え1
ファイルシステムに直接書き込むには、wp-config.php ファイルに次の行を追加できます。
define('FS_METHOD','direct');