I am having issue on PHP where my app is trying to run a php backup file and suddenly getting HTTP Error 500 Code. I have checked the logs and this what it saying.
[Tue Aug 28 14:17:28 2012] [warn] [client x.x.x.x] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://example.com/backup/backup.php
[Tue Aug 28 14:17:28 2012] [error] [client x.x.x.x] Premature end of script headers: backup.php, referer: http://example.com/backup/backup.php
Anyone knows how to fix this? I'm really stuck in here and can't find solution in internet.
Hope anyone could share their knowledge.
Thanks. James
I managed to solved this by adding FcgidBusyTimeout . Just in case if anyone have similar issue with me.
Here is my settings on my apache.conf:
Just install php5-cgi in debian
in Centos
Check /var/lib/php/session and its permissions. This dir should be writable by user so the session can be stored
I had the same problem with long-running scripts with the error messages "Premature end of script headers: index.php" and "Connection reset by peer: mod_fcgid: error reading data from FastCGI server" in error_log. After hours of testing this helps for me (CentOS 6, PHP-FPM 7, Plesk 12.5.30):
edit the config file:
Set a higher running time. In my case 600 seconds
create the new entry:
adapt following entries:
restart httpd:
I increased max execution time to 600 seconds job done !
I came across this one while debugging a virtualmin/apache related error.
In my case, I am running virtualmin and had in my virtual machine's php.ini safe_mode=On.
In my Virtual Machine's error log, I was getting the fcgi Connection reset by peer: mod_fcgid: error reading data from FastCGI server
In my main apache error log I was getting: PHP Fatal error: Directive 'safe_mode' is no longer available in PHP in Unknown on line 0
In my case, I simply set safe_mode = Off in my php.ini and restarted apache.
stackoverflow.com/questions/18683177/where-to-start-with-deprecated-directive-safe-mode-on-line-0-in-apache-error