{"id":1411,"date":"2017-05-04T08:49:30","date_gmt":"2017-05-04T03:19:30","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1411"},"modified":"2017-05-04T08:49:30","modified_gmt":"2017-05-04T03:19:30","slug":"fastcgi-idletimeout-500-error","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/fastcgi-idletimeout-500-error\/","title":{"rendered":"FastCGI: comm with server &#8220;\/usr\/lib\/cgi-bin\/php7-fcgi&#8221; aborted: idle timeout"},"content":{"rendered":"<p><strong>Date Posted: 04-05-2017<\/strong><\/p>\n<p>We are getting continuous 500 internal server on our\u00a0<em>php-fpm\/fcgi\u00a0<\/em>apache server. The log reports the following error<\/p>\n<hr \/>\n<p>[Day\u00a0Month xx 10:09:14.269068 2017] [fastcgi:error] [pid 1422] [client xx.xx.xx.xx:59020] FastCGI: incomplete headers (0 bytes) received from server &#8220;\/usr\/lib\/cgi-bin\/php7-fcgi&#8221;<br \/>\n[Day\u00a0Month \u00a0xx 10:09:46.864781 2017] [fastcgi:error] [pid 1690] [client xx.xx.xx.xx:59021] FastCGI: comm with server &#8220;\/usr\/lib\/cgi-bin\/php7-fcgi&#8221; aborted:<strong> idle timeout<\/strong> (30 sec)<\/p>\n<hr \/>\n<p>The reason for this error, php-fpm idle timeout is low(ie 30). If our code\/application sends large amount of data to process, it may exceeds idle timeout and leads to 500 error.<\/p>\n<h3>Solution:<\/h3>\n<p>To fix the error, increase the idle timeout on php-fpm\/fcgi configuration.<\/p>\n<p>&nbsp;<\/p>\n<p>Open the php-fpm configuration file. If you followed our <a href=\"https:\/\/pheonixsolutions.com\/blog\/install-apache-php-fpm-ubuntu-16\/\">article<\/a>\u00a0, the configuration location will be\u00a0<em>\/etc\/apache2\/conf-enabled\/php7.0-fpm.conf<\/em><\/p>\n<p><code>vi\u00a0\/etc\/apache2\/conf-enabled\/php7.0-fpm.conf<\/code><\/p>\n<p>Edit the line starts\u00a0<em>FastCgiExternalServer\u00a0<\/em>with idle-timout. If you have a separate configuration for each domain, then you need to update particular domain configuration<\/p>\n<blockquote><p>FastCgiExternalServer \/usr\/lib\/cgi-bin\/php7-fcgi -socket \/var\/run\/php\/php7.0-fpm.sock <span style=\"color: #ff6600;\">-idle-timeout 300<\/span> -pass-header Authorization<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>Restart the apache2 and php-fpm services.<\/p>\n<p><code>systemctl restart apache2<\/code><\/p>\n<p><code>systemctl restart php7.0-fpm<\/code><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Date Posted: 04-05-2017 We are getting continuous 500 internal server on our\u00a0php-fpm\/fcgi\u00a0apache server. The log reports the following error [Day\u00a0Month [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[278,330,261,329],"class_list":["post-1411","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-apache","tag-idletimout","tag-linux","tag-php-fpm","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phns3A-mL","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1411"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1411\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}