• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

PHP FastCGI/CGI Problem

N

N3cTr0

Guest
Hi,

Recently setup plesk on a dedicated server. Setup my first domain and ran PHP as FastCGI.

I got nothing but Server 500 Errors:

[Sat Dec 18 12:27:40 2010] [error] [client *.*.*.102] Premature end of script headers: index.php
[Sat Dec 18 12:28:57 2010] [warn] [client *.*.*.34] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

Same error running it as CGI. But if I run it as an Apache module, it works fine.

What can I do to resolve this problem?
 
Hello Igor,

We also have this problem but do not have anything listed under
# grep CGI_PHP_BIN /etc/psa/psa.conf
and looking at the file in vi there is no reference to CGI_PHP_BIN at all. Do we add this manually if it to get PHP over FastCGI to work if the variable doesn't exist?

This problem has only just started after an upgrade from 10.3.1 to 10.4.4.

Thanks
 
For me the origin was error_reporting. It was set to not show php errors on the webpage but to write them in a log.
In your case "Premature end of script headers: index.php " is actually php error, but due to the use of (fast)cgi it causes apache to end up in a 500 error.

Solution (worked for me):
Try to enable showing the errors on your webpage instead of writing them into the log - and be sure to use the correct php.ini file for the relevant domain. Sometimes setting the values via plesk did not work for me... Sure a bug, but I am too lazy to report it right now (waiting for someone else having the same issue and reporting it :p)

Regards
 
Hello sltmedia,

That's not really a viable solution and could lead to a whole range of problems: writing errors to the output is a massive security risk.
 
I'm also having the same problem since upgrading to PHP 5.4.

[Thu Aug 08 10:55:44 2013] [warn] [client 86.134.86.83] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Aug 08 10:55:44 2013] [error] [client 86.134.86.83] Premature end of script headers: index.php

Switching to "apache" does fix it for now, but I would like to use FastCGI. Exactly the same as N3cTr0 (Running Plesk 10.4.4 here).
 
safe-mode from PLESK to be set off has made the trick, but also in php.ini should disable all, safe_mode, magic_quote, and watch logs.
The problem is why I am disapointed, how can this happened?
How can allow PLESk Project Manager to update to a major release of PHP, when everyone complained on forum that it is dangerous, a lot od scripts are incompatible and so on, to do this.
If they decided to force update and PLESK 11.5 support multiple PHP version, why not installed as an alternative as a second PHP solution and in time to not support 5.3??
If you ask me, the person/team who get this decision, should be fired, sorry to say this, but thousand of servers was affected.
Just we have 15 servers and around 1000 clients. Now I get daily phones that site does not working because old CSCart, old WP or etc. SHAME, SHAME, SHAME! Very disapointed!
 
Back
Top