Page 1 of 1

php-fpm and AH01067: Failed to read FastCGI header

Posted: 2017/03/27 01:01:53
by wilburunion
It appears php-fpm is causing a 503 service unavailable error on certain scripts => AH01067: Failed to read FastCGI header - according to the log

This seems to be common - but i have not found a common path to fix it. I am running 2.4.25 Apache from Codeit with php 5.6.30 from remi

I have another CentOS 7 server - same Apache set up - NOT running php-fpm and it works fine on the same command which fails on the php-fpm system.

Otherwise they are identical

Some people find the error is related to opcache. and the answer is to - increase opcache.max_accelerated_files from default 4000 to about 16000. I do not believe i am running opcache (Zend engine opcache in phpinfo)

The other suggestion is to increase ProxyTimeout to a large number like 600 seconds - 10 minutes

Percona says increase the max_execution_time of php in the ini to a high number and connect_timeout in the my.cnf accordingly with plenty of execution memory available

The issue is clearly php-fpm as the other identical server on the plain apache 2.0 handler works

Does anyone know if there is a parameter to adjust to solve this in the php-fpm *.conf pool files in /etc/php-fpm.d ??

OR - HOW this is solved on Centos 7 set up of php-fpm on php-fpm.x86_64 - 5.6.30-1.el7.remi which what i have installed ( and
php70-php-fpm.x86_64 - 7.0.17-1.el7.remi - BUT I am not using that one)

*** EDIT ***

Apparently php-fpm has a 30 second hard-coded timeout - which was fixed in Apache (red hat) to honor the Proxytimeouut directive


Remi has addressed it here => with some examples

I will give them a whirl - if someone knows the sure way - I am using unix sockets per domain

Re: php-fpm and AH01067: Failed to read FastCGI header

Posted: 2017/03/27 05:54:17
by remirepo
Already answered on

And usually, 3rd party repository, no shipped by centos are not supported here