Jump to content

Unknown Post Length at Unkown at line 0


d22552000

Recommended Posts

1. I AM NOT SENDING ANY HEADERS IN MY SCRIPT!!!

2. This only happens in my search script SINCE I changed the max post length in php.ini

3. I have more than 4GB of ram, and my virtual memory page file is 3x4GB page files.

 

ERROR:

Warning: Unknown: POST Content-Length of XX bytes exceeds the limit of -1048576 bytes in Unknown on line 0
Warning: Cannot modify header information - headers already sent in Unknown on line 0

 

sometimes it says "exceeds the limit of 0 bytes" in the output...

where XX is a number of bytes from 3-30 depending on the user's search...

 

PHP.INI CHANGED VALUES:

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 480     ; Maximum execution time of each script, in seconds
max_input_time = 960	; Maximum amount of time each script may spend parsing request data
memory_limit = 4096M      ; Maximum amount of memory a script may consume (16MB)

;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
;
; Maximum size of POST data that PHP will accept.
post_max_size = 4095M

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
;
; Maximum allowed size for uploaded files.
upload_max_filesize = 4090M

 

FULL PHP CODE:

<?PHP

//search.php:

include('./HTML/html.php');

include('../log.php');

$SELF =        $_SERVER['PHP_SELF'];
$HOST =       $_SERVER['HTTP_HOST'];
$RADD =     $_SERVER['REMOTE_ADDR'];
$RHST =     $_SERVER['REMOTE_HOST'];
$RPRT =     $_SERVER['REMOTE_PORT'];
$REFR =    $_SERVER['HTTP_REFERER'];
$REQU =    $_SERVER['REQUEST_TIME'];
$QURY =    $_SERVER['QUERY_STRING'];
$CONN = $_SERVER['HTTP_CONNECTION'];
$USAG = $_SERVER['HTTP_USER_AGENT'];

__log($SELF,$HOST,$RADD,$RHST,$RPRT,$REFR,$REQU,$QURY,$CONN,$USAG);

if (!empty($_POST['search'])) {
  $mysearch =$_POST['search'];
  $mysearch = trim($mysearch);
   if (!$mysearch || $mysearch=='')
     html('Search, No Results!','No Results Were Returned!');
   if (strlen($mysearch)<2)
     html('Search, Small Terms','The terms you used to search are too small.  Three characters minimum.');
   if (!strpos($mysearch,'%')===false)
     html('Search, Bad Results','Your search terms had one or more % (percent) characters in it.  This is not allowed.');

  /* MYSQL CONNECTION */
  mysql_connect(localhost,'root','');

$sql = "SELECT * FROM `filepirate`.`files` ";
$sql.= "WHERE `Name` LIKE '%$mysearch%' ";
$sql.= "OR `Description` LIKE '%$mysearch%'";

   $result = mysql_query($sql);
   if (!$result)
      html('Search, No Results!','No Results Were Returned!');

   $num_books = mysql_num_rows($result);
   if ($num_books ==0)
      html('Search, No Results!','No Results Were Returned!');

$RET = '<h2>Search<br/><font size="3">Returned '.$num_books.' Results</font></h2>
  <TABLE width="75%">
  <TR><TH>File Name</TH><TH>Description</TH><TH>Downloads</TH></TR>
  ';

while(list($ID,$Name,$P,$Description,$T,$Downloads)= mysql_fetch_row($result)) { $RET.= "
  <TR><TD><a href='./FORM/Files.php?download&id=$ID'>$Name</a></TD><TD>$Description</TD><TD>$Downloads</TD></TR>
  ";
}
$RET.= '</TABLE>';
} else {
$RET = '<h2>Search</h2><form action="search.php" method="POST">Search Term(s): <input type="text" name="search" /></form>';
html('Search!',$RET);
}

html('Search Returned '.$num_books.' Results.',$RET);

?>

 

HTML.PHP CODE:

<?PHP

//html/html.php

<?PHP

function css() {
echo 'A HUGE AMOUNT OF CSS WITH ALL THE \' ESCAPED.'; exit();
}

function html($TITLE,$RET,$BASE=false,$SHIT=false,$ECT="") {
$a=@file_get_contents('../pl.cnt'); $a++;
file_put_contents('../pl.cnt',$a);

$last=@file_get_contents('lastview');
$a = time() + microtime() / 10;
file_put_contents('lastview',$a);

$last = time() + microtime() - $last + microtime() / 10;

$RET = str_replace('{{last}}',round($last,5),$RET);

echo 'A HUGE AMOUNT OF HTML WITH ALL THE \' ESCAPED';
if ($BASE) {
echo 'A HUGE AMOUNT OF HTML WITH ALL THE \' ESCAPED';
} else {
echo 'A HUGE AMOUNT OF HTML WITH ALL THE \' ESCAPED';
}
if ($SHIT) { echo ''A HUGE AMOUNT OF JAVASCRIPT WITH ALL THE \' ESCAPED'';
}
echo 'A HUGE AMOUNT OF HTML WITH ALL THE \' ESCAPED';
if ($BASE) {
echo 'A HUGE AMOUNT OF HTML WITH ALL THE \' ESCAPED';
}
echo 'A HUGE AMOUNT OF HTML WITH ALL THE \' ESCAPED'; exit();
}

?>

 

LOG.PHP:

<?PHP

function __log($SELF,$HOST,$RADD,$RHST,$RPRT,$REFR,$REQU,$QURY,$CONN,$USAG) {

/* MYSQL CONNECTION */
mysql_connect(*****);

$SQL = "INSERT INTO `*`.`logs` (
       `PHP_SELF`,
      `HTTP_HOST`,
    `REMOTE_ADDR`,
    `REMOTE_PORT`,
   `HTTP_REFERER`,
   `REQUEST_TIME`,
   `QUERY_STRING`,
`HTTP_CONNECTION`,
`HTTP_USER_AGENT`
)
VALUES (
'$SELF',
'$HOST',
'$RADD',
'$RPRT',
'$REFR',
NOW( ) ,
'$QURY',
'$CONN',
'$USAG'
);";

mysql_query($SQL);
mysql_close(*****);
}

?>

 

I was told that sizes had to be in order of (largest to smallest) : mem_size, post_size, file_size;

I was told that if it was not in this order it would not catch post errors.

Link to comment
Share on other sites

*BUMP* this is on my site and it has had over 300 complaints about hte search nto working the last 2 hours.  If you could please help it would REALLY be aprceiated.

 

BTW I get these errors EVEN when I dont include log or html in it, I get it when I do the BARE guts of this.

 

THE FUNNIEST PART is that my file upload section STILL WORKS, and it has a password and description text field, as well as 5 file input fields, and they upload with no errors.

Link to comment
Share on other sites

who doesnt... some people don't know how to do any different uploads besides HTTP, BTW we do mass site moves and have a very large buffer...

 

I guess I will have to use PERL to handle the upload.. *sigh* I really hate perl.  ANyways, I set the limites back down to 1GB,512MB, and 500MB.  Unfortunetely really.

 

I am also allowing 4GB max post size cause the multi-upload form allows 10 files and I know some people will upload uncompressed videos (800-1200 MB) per file...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.