1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

PHP FastCGI/CGI Problem

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by N3cTr0, Dec 18, 2010.

  1. N3cTr0

    N3cTr0 Guest

    0
     
    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?
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,557
    Likes Received:
    1,242
    Location:
    Novosibirsk, Russia
  3. Red Paint

    Red Paint Basic Pleskian

    26
    23%
    Joined:
    Aug 19, 2009
    Messages:
    78
    Likes Received:
    1
    Hello Igor,

    We also have this problem but do not have anything listed under
    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
     
  4. sltmedia

    sltmedia New Pleskian

    13
    35%
    Joined:
    Feb 1, 2012
    Messages:
    9
    Likes Received:
    0
    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
     
  5. Red Paint

    Red Paint Basic Pleskian

    26
    23%
    Joined:
    Aug 19, 2009
    Messages:
    78
    Likes Received:
    1
    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.
     
  6. RolandE

    RolandE New Pleskian

    15
    85%
    Joined:
    Sep 22, 2010
    Messages:
    8
    Likes Received:
    0
  7. PHPini

    PHPini New Pleskian

    6
    20%
    Joined:
    May 12, 2013
    Messages:
    2
    Likes Received:
    0
    I am getting this problem after installing PHP 5.4, Any fix for this yet?
     
  8. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    965
    Likes Received:
    32
    Location:
    Romania
    I get this as well suddenly :-(
     
  9. MikePolo

    MikePolo New Pleskian

    15
    55%
    Joined:
    Mar 11, 2011
    Messages:
    1
    Likes Received:
    0
    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).
     
  10. SinglehopChris

    SinglehopChris New Pleskian

    6
     
    Joined:
    Aug 9, 2013
    Messages:
    1
    Likes Received:
    0
    Location:
    Chicago, IL
    Try setting 'safe_mode=off' in the domains Plesk account. It may be on by default.
     
  11. mavera2

    mavera2 Basic Pleskian

    11
    85%
    Joined:
    Aug 9, 2013
    Messages:
    64
    Likes Received:
    0
  12. lvalics

    lvalics Silver Pleskian Plesk Guru

    36
    43%
    Joined:
    Jun 20, 2003
    Messages:
    965
    Likes Received:
    32
    Location:
    Romania
    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!
     
Loading...