1

I have a situation here, while uploading larger files(greater than 10mb) nothing happens, no file is uploading, no db entry, no error messages etc., I'am using Yii.. phpinfo says upload_max_filesize and post_max_size are 1G and max_execution_time is 3600 .After submitting the form, the page loads for sometime and came back to its old stage(fresh form). can't find the exact issue.

Update:

After checking server error log I got this

PHP Warning: POST Content-Length of 17481302 bytes exceeds the limit of 8388608 bytes in Unknown on line 0, then what to do?

update 2

The issue resolved

When you see error like that in log, you can check these values

upload_max_filesize = post_max_size =

in /etc/php.ini (not in user’s php.ini)

arun
  • 3,667
  • 3
  • 29
  • 54

3 Answers3

1

Check you memory_limit. Generally, memory_limit should be larger than post_max_size

CreatoR
  • 1,654
  • 10
  • 14
  • yes its 8M now, can I set it to some large value say 1G, or is it have any relation to other internal things or other configurations? – arun Nov 05 '13 at 09:50
  • getting the same log : `PHP Warning: POST Content-Length of 17481302 bytes exceeds the limit of 8388608 bytes in Unknown on line 0` – arun Nov 05 '13 at 10:00
  • Setting it parameter to 1G is not a good idea, because one or few instanse may use all memory in the server. Try to set 32M at first. As for me, better to use this solution http://www.plupload.com/ - it uplode file by chunks and you can use normal `upload_max_filesize`, `max_execution_time ` and `post_max_size ` – CreatoR Nov 05 '13 at 10:01
  • Changed post_max_size and upload_max_size to 20M and memory_limit to 32M, and then tried to upload a 16mb file, issue is still there, server error log says the same `PHP Warning: POST Content-Length of 17470650 bytes exceeds the limit of 8388608 bytes in Unknown on line 0` – arun Nov 05 '13 at 10:10
  • Can you in the beginnig `.php` file, which receive file, make: `exit( ini_get('upload_max_filesize').':'.ini_get('post_max_size').':'.ini_get('memory_limit') );` - I think something wrong with setting this params. And show me result – CreatoR Nov 05 '13 at 10:14
  • `20M:20M:` got this only `ini_get('memory_‌​limit') ` is empty :O – arun Nov 05 '13 at 10:16
  • it's strange, because you set memory_limit to 32M. [Here](http://stackoverflow.com/questions/6315358/php-warning-post-content-length-of-113-bytes-exceeds-the-limit-of-1988100096-b) a good answer, maybe helps you – CreatoR Nov 05 '13 at 10:21
  • for test, try set `memory_limit` to `-1` (it means unlimited) – CreatoR Nov 05 '13 at 10:43
  • My server admin did something, now its ok, I asked him that what causes that issue, after his mail arrived I'll comment or post that here. thanks for your time @creatoR – arun Nov 05 '13 at 10:48
  • And another one test: make `ini_set` in file (from previous comment) for all parameter: `ini_set('upload_max_filesize', '30M'); ini_set('post_max_size', '30M'); ini_set('memory_‌​limit', '30M');` and try to upload file with 16MB – CreatoR Nov 05 '13 at 10:48
0

sorry i misunderstood the problem.here is my new answer.you are probably facing the problem because of the limited size of post_max_size and upload_max_filesize in your php configuration file.i.e.php.ini

so please change "post_max_size",upload_max_filesize from 8M to 32M in php.ini.your problem will be solved :) and then restart your server

R R
  • 2,999
  • 2
  • 24
  • 42
  • nop, I dint load the file into db(only file name, i just tried to say that noting happens if my form contains a larger file), the problem is not with this.. – arun Nov 05 '13 at 09:41
  • u mean to say nothing happens when your filename is larger? – R R Nov 05 '13 at 09:45
  • yep bro.. got this server error log `PHP Warning: POST Content-Length of 17481302 bytes exceeds the limit of 8388608 bytes in Unknown on line 0` – arun Nov 05 '13 at 09:46
  • than change "post_max_size" from 8M to 32M in php.ini.your problem will be solved :) and then restart your server – R R Nov 05 '13 at 09:47
  • Already changed that to 1G, but nothing happens...,or exactly put 32M? – arun Nov 05 '13 at 09:48
  • Already did bro, after that I posted my question, but now I feels like may be issue with memory_limit, checkng.. – arun Nov 05 '13 at 09:54
  • @arun_php please change the limit of upload_max_filesize also. – R R Nov 05 '13 at 10:02
0

Server Admin's Reply Regarding the issue,

When you see error like that in log, you can check these values

upload_max_filesize =
post_max_size =

in /etc/php.ini (not in user’s php.ini)

arun
  • 3,667
  • 3
  • 29
  • 54