I have an Ubuntu virtual server where I host my php website with the newest version of Plesk 12 and PHP 5.5. Sometimes (I believe when I open pages quickly one after another), I get an Internal Server error message..
When I refresh the page, the site is normal again immediatly, but sometimes the error message dissappears after about one minute later.
this is what I get on the page:
Internal Server Error 500.
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Error log:
[fcgid:warn] [pid 26583] (104)Connection reset by peer: [client (ip
address)] mod_fcgid: error reading data from FastCGI server, referer:
(url here) [core:error] [pid 26583] [client (ip address)] End of script output
before headers: index.php, referer: (same url here)
2
Answers
Given your error log it looks like the index page wanted to write an HTTP header (with either header() or set_cookie or similar) AFTER it printed regular output, in your case probably a warning message due to an interrupted connection.
What I would try to do is disable all error output in the page with the php.ini, but still log the errors.
PHP can only output HTTP header fields before any other regular output, warning and error messages on the page included. So if you direct all errors and warnings only to the log files, and NOT print them on the page, there will be no output before the HTTP header and it should work fine.
If any PHP script causes an error, try following this procedure:
error_log
for actual errors, fix them accordinglyIf configuration files like
apache.conf
have an error in them it will not appear in the error log with FastCGI on.