The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to debug PHP script with "Premature end of script headers"

Discussion in 'General Discussion' started by SoftDux, Jun 19, 2007.

  1. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    I'm getting a 500 internal server error with a PHP script, and all I can see in the logs are as follows:

    Code:
    [Tue Jun 19 10:03:51 2007] [error] [client 198.54.202.100] Premature end of script headers: /home/ucan/public_html/support/index.php
    
    How do I debug this?
     
  2. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Those can be tricky to track down, but usually indicate a return or some other whitespace after the closing ?> in your script
     
  3. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Are you using phpsuexec or suphp? Check the permissions of the PHP script and the directory containing it. Directories should have a permission setting of 755 and PHP scripts should have a permission setting of 644.
     
Loading...

Share This Page