+2 votes
in Web & Google by (15.0k 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

0 votes
by (25.0k points)

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.


request_terminate_timeout = 180s

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


php_admin_value[max_execution_time] = 180