Page 1 of 1

More header problems.

Posted: Sun Jul 18, 2004 11:18 am
by AlbinoJellyfish
I dont know, I run my own server and this script ran fine. When I uploaded it to my host, they gave me this error in the apache log.

Code: Select all

їSun Jul 18 12:08:52 2004] їerror] їclient 12.285.1.236] Premature end of script headers: php-script
My script:

Code: Select all

<?php
session_start();
header("Cache-control: private");
error_reporting(E_ALL);
?>
<html>
<head><LINK href="generic.css" 
type=text/css rel=stylesheet>
<style>
<!--
BODY{
scrollbar-face-color:#4b4b4b;
scrollbar-arrow-color:#ff6600;
scrollbar-track-color:#4b4b4b;
scrollbar-shadow-color:#363636;
scrollbar-highlight-color:#4b4b4b;
scrollbar-3dlight-color:#919191;
scrollbar-darkshadow-Color:#363636;
}
-->
</style></head>
<body BGCOLOR=#4b4b4b>
<form method="post" action="formmail1.php">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<input type="hidden" name="path_to_file" value="/home/albinojellyfish/public_html/formmail">
<input type="hidden" name="require" value="email,password,password2,username">
<input type="hidden" name="recipient" value="sales@sevengfx.com">
<input type="hidden" name="sort" value="alphabetic">
<input type="hidden" name="ar_file" value="/www/formmail_path/autoresponder.txt">
<input type="hidden" name="ar_subject" value="Thank you for your interest!">
<input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
  <p><font size="4">Please enter in all information.</font></p>
  <b>What package would you like?</b> 
  <table>
<font color=FF6600><tr> 
      <td width="261">&nbsp;<input type="radio" class="radio" name="package" value="PSD">
        PSD only<br>&nbsp;<input type="radio" class="radio" name="package" value="twopage">
        2 page design<br>&nbsp;<input type="radio" class="radio" name="package" value="Fullsite">
        Full Site</td><td>$10<br>$20<br>$30</td>
    </tr>
    <tr> 
      <td> <b>What extras would you like?</b> <br>
        &nbsp;<input class="radio" type="checkbox" name="rollovers" value="Yes">
        Javascript Rollovers <br>
        &nbsp;<input type="checkbox" class="radio" name="news" value="Yes">
        PHP News System&nbsp; <br>
        &nbsp;<input type="checkbox" class="radio" name="flash" value="1">
        Flash Navigation &nbsp;&nbsp;&nbsp;&nbsp; </td>
		
      <td><br>Free (for a limited time)<br>
        $5<br>$5</td>
    </tr>
	  <tr> 
      <td>Your Name</td>
      <td width="397"><input type=text name="name"></td>
    </tr
    <tr> 
      <td>Your Email Address</td>
      <td width="397"><input type=text name="email"></td>
    </tr>
    <td><p>Your Username</p></td>
    <td><input type=text name="username"></td>
    </tr>
    <tr> 
      <td>Your Password</td>
      <td><input type=password name="password">
        Please Make it 6-12 Characters</td>
    </tr>
    <tr> 
      <td>Confirm Password</td>
      <td><input type=password name="password1"></td>
    </tr>
    <tr> 
      <td><p>Any specifics or information on the design:</p></td>
      <td><textarea name="design" cols="60" rows="6"></textarea></td>
    </tr>
    <tr> 
      <td><p>Preferred Payment Method:</p></td>
      <td><select name="select">
		Select one:
          <option value="Paypal">Paypal</option>
          <option value="Check">Check</option>
        </select></td>
    </tr>
    <tr> 
      <td colspan="2"><input name="submit" type="submit">
        <input name="reset" type="reset"></td>
    </tr></font>
  </table>
</form>
</body>
</html>
Ive even removed the sessionstart, but it still doesnt work. Any ideas? :?:

Posted: Sun Jul 18, 2004 11:42 am
by JAM
Is the host using PHP as module or CGI?

Posted: Sun Jul 18, 2004 11:48 am
by AlbinoJellyfish
How would I figure that out?

Posted: Sun Jul 18, 2004 11:55 am
by feyd

Code: Select all

<?php phpinfo(); ?>
I believe..

Posted: Sun Jul 18, 2004 12:00 pm
by JAM

Code: Select all

<?php
$sapi_type = php_sapi_name();
if ($sapi_type == "cgi") {
   echo "You are using CGI PHP\n";
} else {
   echo "You are not using CGI PHP\n";
}
?>

Posted: Sun Jul 18, 2004 12:30 pm
by AlbinoJellyfish
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.


great

Posted: Sun Jul 18, 2004 12:45 pm
by JAM
Looks like CGI.
Make sure you uploaded the file using ascii mode, and not binary.
Make sure (odd if so) that the webserver have permission to run the file, chmod() it to 755 to verify.

google for "Internal Server Error php-cgi" and do some more reading, as I'm not entitled to judge what might be the issue. =/
I know that if you get an error in the script, the "Internal Server Error" is what the server will spit out, running in CGI mode. If the module version were to be used, you'd get the PHP's internal error reporting system giving you messages, something I prefer. Is it possible to make the host change this perhaps?

Neverless, good luck to you. Please let us know what and who solved it.

Posted: Sun Jul 18, 2004 10:19 pm
by AlbinoJellyfish
Ok, no idea what happend, but on the subdomain it doesnt work, but on the main domain it does. I guess that is fine. If anyone else can figure anything else out that would be fine.