0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WordPress 管理画面で発生するプラグイン Ajax エラーを解消

Last updated at Posted at 2019-08-17

環境

1時間で出来る!最強のWordPress環境構築(永久無料) を参考に Google Cloud Platform 上に
WordPress 環境を構築。

当方の設定過不足が原因かと思われますが、メモとして残します。

症状

WordPress 管理画面にてプラグイン IP Geo Block の設定ページを開くと以下のエラーアラートが表示される。

Ajaxコマンド ip_geo_block の実行中にエラーが発生しました。 (0)

Chrome の Console を確認すると admin-ajax.php で POST エラーが発生していることがわかる。

作業

プラグインからの admin-ajax.php へのアクセスを許可する為に htaccess 設定を行います。

Bitnami の WordPress ではセキュリティおよびパフォーマンス上の理由から .htaccess ファイルが無効に
設定されているので htaccess.conf を使用します。
https://community.bitnami.com/t/how-to-access-the-htaccess-conf-file/38410/2


Google Cloud Platform -> Compute Engine -> VMインスタンス
接続 欄の SSH をクリックしてコンソールを起動して htaccess.conf を編集する。

$ cd /opt/bitnami/apps/wordpress/conf/
$ sudo vi htaccess.conf
htaccess.conf
<Directory "/opt/bitnami/apps/wordpress/htdocs/">
    <FilesMatch "(admin-ajax.php)$">
        Satisfy Any
        Order allow,deny
        Allow from all
        Deny from none
    </FilesMatch>
</Directory>

サーバーを再起動する。

$ sudo /opt/bitnami/ctlscript.sh restart nginx
Unmonitored nginx
/opt/bitnami/nginx/scripts/ctl.sh : Nginx stopped
/opt/bitnami/nginx/scripts/ctl.sh : Nginx started
Monitored nginx

WordPress 管理画面にてエラーが解消されていることを確認する。

参考

https://blog.systemjp.net/entry/2017/08/12/001704
https://kimiyakitani.wordpress.com/2014/02/13/how-to-resolve-admin-ajax-error/
https://www.d-wood.com/blog/2016/05/25_8076.html
https://www.radia.jp/archives/319

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?