3
1

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.

wp-cron.php の 499 エラーの対処法

Last updated at Posted at 2016-06-29

環境と概要

  • CentOS 6.7
  • nginx 1.10.1
  • php 7
  • WordPress

アクセスログに次のようなエラーが大量に記録される。

access.log
192.0.2.1 - - [01/Jun/2016:05:27:38 +0900] "POST /wp-cron.php?doing_wp_cron=1464726557.8682820996966554734375 HTTP/1.0" 499 0 "-" "WordPress/4.5.2; http://example.jp" "-"
192.0.2.1 - - [01/Jun/2016:05:31:21 +0900] "POST /wp-cron.php?doing_wp_cron=1714472866.7813869780316166109375 HTTP/1.0" 499 0 "-" "WordPress/4.5.2; http://example.jp" "-"
192.0.2.1 - - [01/Jun/2016:06:35:13 +0900] "POST /wp-cron.php?doing_wp_cron=1964520202.6834461245782472703125 HTTP/1.0" 499 0 "-" "WordPress/4.5.2; http://example.jp" "-"

対処法

phpの処理がタイムアウトすると発生するらしい。

よって、タイムアウト時間を長くすると良い。

値の600(秒)は各自の環境に合わせて調節すること。

php-fpm編

php-fpmの設定ファイルを開く

vi /etc/php.ini

次の値を更新

php.ini
max_execution_time = 600

nginx編

nginxの設定ファイルを開く

vi /etc/nginx/nginx.conf

次の値を更新

nginx.conf
fastcgi_read_timeout    600;
fastcgi_send_timeout    600;

変更の適用
/etc/init.d/nginx restart
/etc/init.d/php-fpm restart

参考リンク

Increase PHP script execution time with Nginx
nginx でupstream timed outエラーが発生した時の対処 | レンタルサーバー・自宅サーバー設定・構築のヒント

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?