転載・引用について

ユーザ用ツール

サイト用ツール


tweet:2018:0111_01

WordPressとFacebookの連携

WPに投稿した記事を自動でFBに投げてくれるPluginとして、Facebook Auto Publishがあるが、どハマったのでメモ

なお、無料で(Donateは可能)利用できるこの手のPluginで、2018/01時点のFB APIにOAuthレベルで完全に対応しているのはこれだけだった。 とてもありがたい。

ただし、もし、SettingのAuthorizeがうまくいかなくて、NGINXのlogに

NGINX Error log (URL is changed to example.jp)
2018/01/11 18:30:20 [error] 27732#100162: *40 FastCGI sent in stderr: "PHP message: PHP Warning: session_start(): Cannot start session when headers already sent in /usr/home/www/wordpress/wp-content/plugins/facebook-auto-publish/admin/authorization.php on line 9
PHP message: PHP Warning: Cannot modify header information - headers already sent by (output started at /usr/home/www/wordpress/wp-includes/formatting.php:5100) in /usr/home/www/wordpress/wp-content/plugins/facebook-auto-publish/admin/authorization.php on line 28
PHP message: PHP Warning: Cannot modify header information - headers already sent by (output started at /usr/home/www/wordpress/wp-includes/formatting.php:5100) in /usr/home/www/wordpress/wp-content/plugins/facebook-auto-publish/admin/authorization.php on line 34" while reading upstream, client: 10.2.101.41, server: example.jp, request: "POST /wp-admin/admin.php?page=facebook-auto-publish-settings HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.jp", referrer: "https://example.jp/wp-admin/admin.php?page=facebook-auto-publish-settings"

みたいなエラーが出ていたならば、以下のどちらかを行うこと

  1. enable the output buffering in the server
  2. uncomment the code ob_start(); in the file facebook-auto-publish.php (line no. 32)

但し、自分のところでは、1ではだめだったので、2を行なった。 おそらく、一番最初の時だけ問題になると思われるので、PluginのUpdateには影響がないと信じて…

そのうち、詳細を書かないといかんなぁ。

このウェブサイトはクッキーを使用しています。 Webサイトを使用することで、あなたはあなたのコンピュータにクッキーを保存することに同意します。 また、あなたはあなたが私たちのプライバシーポリシーを読んで理解したことを認めます。 同意しない場合はウェブサイトを離れてください。クッキーに関する詳細情報
tweet/2018/0111_01.txt · 最終更新: 2018/01/11 19:04 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki