/wp-admin/admin-ajax.php 500エラー
-
お世話になります。
先日、サーバーをロリポップのレンタルサーバーから、さくらVPSに移行したところ、
「WP User Frontend Pro」というフロント側で投稿が行えるプラグインで、投稿ページで投稿完了のsubmitを押しても何も起きないというエラーが発生しております。事象として以下です。
・通常はsubmitを押すと、投稿した記事のページに遷移されるのですが、ページ遷移せずに何も起きない。
・投稿自体は反映されている。
・submitボタン投下後、console画面には以下のようなエラーが表示される。
Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://○○○.jp/wp-admin/admin-ajax.phpレンタルサーバーの方は、通常通り機能していたので、おそらくnginx等の設定に何か問題があるのではないかと考えております。
エラーログは以下のようになっております。
——————————
#4 {main}thrown in /usr/share/nginx/wordpress/wp-content/plugins/wp-user-frontend/class/frontend-form-post.php on line 398″ while reading response header from upstream, client: ○○.○○.○○.○○, server: gumpla.jp, request: “POST /wp-admin/admin-ajax.php HTTP/1.1”, upstream: “fastcgi://unix:/run/php-fpm/php7.sock:”, host: “○○○.jp”, referrer: “http://○○○.jp/post”
2017/05/16 16:42:40 [error] ○○○#○○○: *○○○ FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Class ‘DOMDocument’ not found in /usr/share/nginx/wordpress/wp-content/plugins/wp-user-frontend/class/frontend-form-post.php:398
Stack trace:
#0 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(298): WPUF_Frontend_Form_Post->submit_post(”)
#1 /usr/share/nginx/wordpress/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(”, Array)
#2 /usr/share/nginx/wordpress/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /usr/share/nginx/wordpress/wp-admin/admin-ajax.php(91): do_action(‘wp_ajax_wpuf_su…’)
#4 {main}
thrown in /usr/share/nginx/wordpress/wp-content/plugins/wp-user-frontend/class/frontend-form-post.php on line 398″ while reading response header from upstream, client: ○○.○○.○○.○○, server: gumpla.jp, request: “POST /wp-admin/admin-ajax.php HTTP/1.1”, upstream: “fastcgi://unix:/run/php-fpm/php7.sock:”, host: “○○○.jp”, referrer: “http://○○○/edit?pid=○○○&_wpnonce=○○○”
—————————————-
なお、「Fatal error: Uncaught Error: Class ‘DOMDocument’ not found in 」については、
調べたところ、libxmlがインストールされていないのが原因だというのを見つけて、「yum install php-xml」でインストールをしてみましたが、すでにインストールされていたようで、解決には至りませんでした。/usr/share/nginx/wordpress/wp-content/plugins/wp-user-frontend/class/frontend-form-post.php on line 398に該当する箇所
—————————————-
397 if ( !empty( $postarr[‘post_content’] ) ) {
398 $dom = new DOMDocument();
399 @$dom->loadHTML( $postarr[‘post_content’] );
400 $images = $dom->getElementsByTagName( ‘img’ );
401
402 if ( $images->length ) {
403 foreach ( $images as $img ) {
404 $url = $img->getAttribute( ‘src’ );
405 $url = str_replace( array( ‘”‘, “‘”, “\\” ), ”, $url );
406 $attachment_id = wpuf_get_attachment_id_from_url( $url );
407
408 if ( $attachment_id ) {
409 wpuf_associate_attachment( $attachment_id, $post_id );
410 }
411 }
412 }
413 }
—————————————-また、wordpressの構築環境は以下のようになっております。
・centOS7
・nginx/1.13.0
・php7-fpm
・MySQL5.7なお、サーバー移行に関しては初心者で、上記に記載した内容だけでは判断できないかもしれませんが、
もし何か必要な情報などございましたら可能な限りお伝えさせていただきますので、
何か解決方法がありましたらお教えいただければと思います。どうぞよろしくお願いいたします。
トピック「/wp-admin/admin-ajax.php 500エラー」には新たに返信することはできません。