Jump to content

Unknown: POST Content-Length of xxx bytes exceeds the limit of xxx bytes in Unknown on line 0


Recommended Posts

What might be causing this error?  How would you recommend troubleshooting?  Thanks

[Tue Feb 17 13:34:32 2015] [error] [client 11.22.33.44] PHP Warning:  Unknown: POST Content-Length of 97807773 bytes exceeds the limit of 8388608 bytes in Unknown on line 0, referer: https://foo.bar.example.com/administrator/index.php?cid=2&controller=buy&id=1949621100

Need to raise the post_max_size in php.ini to higher than 8M

 

93.27 MB seems like a large amount for a post

Edited by QuickOldCar

Maybe sharing the problematic code would actually help troubleshooting this. It's kinda hard to know what you're doing wrong if we don't know what you're doing in the first place.

Maybe sharing the problematic code would actually help troubleshooting this. It's kinda hard to know what you're doing wrong if we don't know what you're doing in the first place.

 

That is the issue.  I don't know what the problematic code is.  It is just a line in my error log.  Line 0?  What is line zero?  What file did the error occur in?  All my other log entries look something like the following, and I have a clue where to start looking:

[Mon Feb 16 10:48:09 2015] [error] [client 22.33.444.555] PHP Fatal error:  Call to undefined method com_maintainance_controller_default::save() in /var/www/example/application/classes/site_frontback.php on line 150, referer: https://foo.bar.example.com.com/index.php?cid=22&preview=640030448

Need to raise the post_max_size in php.ini to higher than 8M

 

93.27 MB seems like a large amount for a post

 

Again, don't want to needlessly increase some parameter until I know what is causing it.

Well, what are you POSTing? Is it from a form? Some dynamic AJAX? What is so large that is being sent in POST? We have no idea what's causing it either as you haven't provided any code to go on other than an error message which states you are POSTing too much data for your current post_max_size setting. So the answers addressed that point.

CroNiX,

 

As far as I know, I am not posting anything which is causing this error.  I just looked in my error log and saw the message.  Maybe someone is hitting my server using cURL, and it isn't me at all.  But if someone is and it is causing php errors, I should at least know the nature of the error and it's potential impact, agree?

 

It seems like the clue is in Unknown on line 0, where normally I see in /var/www/example/application/classes/site_frontback.php on line 150.

 

What could cause the filename from showing up as Unknown and the line as showing up as 0?

Turns out it was something I was doing.  Using an older version of FineUploaderBasic (xhr streaming file uploading) caused the warning.  The file was uploaded so I didn't know there was an error.

the error contains that information (or lack of) because it's occurring before php passes control to any of your php scripts. the content size header is sent by the client to the web server at the start of the request. when the size is greater than the post max size setting, an abort response is sent back (for those clients that observe the response) to try and prevent the client from sending the too large of a file, then php processes the uploaded file, setting the $_FILES array values based on the result of the upload. php then passes control to the .php page that was requested.

 

that's all the information that php has at the point where that error was detected. it would be up to your form processing code to detect when the upload didn't work and take an appropriate action. exceeding the post max size setting will result in empty $_FILES and $_POST arrays and can specifically be detected by checking the $_SERVER['CONTENT_LENGTH'] (which would be in bytes) vs the post_max_size setting (which may be in abbreviated notation, i.e. 20M.)

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