skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. If any PHP script causes an error, try following this procedure:

    1. Switch from FastCGI to CGI
    2. Trigger an error with another request
    3. Inspect error_log for actual errors, fix them accordingly
    4. Switch back to FastCGI

    If configuration files like apache.conf have an error in them it will not appear in the error log with FastCGI on.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search