+2 votes
in Web & Google by (71.8k points)
I am using a PHP script to download image files from YouTube. It runs for a few seconds and then gives error "Error code 500". I checked the error log of the domain and found this error  "Failed to read FastCGI header".

How can I fix this error?

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

Did you check the file phpX.X-fpm.log, where X.X represents your PHP version?

If you see error "execution timed out" in the phpX.X-fpm.log file, you need to increase the value of the parameter "request_terminate_timeout" in "php-fpm.conf". The parameter "request_terminate_timeout" may be present in php-fpm configuration file of your domain.

E.g.

request_terminate_timeout = 180s

You can also increase the value of the parameter "max_execution_time".

E.g.

php_admin_value[max_execution_time] = 180

Related questions

+3 votes
1 answer
+3 votes
1 answer
+3 votes
1 answer
+2 votes
1 answer

...