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)

6
  • just store the reference of that file in your db not the whole file. Commented Nov 5, 2013 at 9:27
  • @RishabhRaj The form contains some other inputs too, thts wht i said.. Commented Nov 5, 2013 at 9:29
  • did you try increasing the max_allowed_packet in the my.cnf file? Commented Nov 5, 2013 at 9:31
  • @RishabhRaj, Ihave my php.ini config file, where is this my.cnf file located Commented Nov 5, 2013 at 9:33
  • i posted an answer.have a look. Commented Nov 5, 2013 at 9:40

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

10 Comments

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?
getting the same log : PHP Warning: POST Content-Length of 17481302 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
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 plupload.com - it uplode file by chunks and you can use normal upload_max_filesize, max_execution_time and post_max_size
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
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
|
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

7 Comments

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..
u mean to say nothing happens when your filename is larger?
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
than change "post_max_size" from 8M to 32M in php.ini.your problem will be solved :) and then restart your server
Already changed that to 1G, but nothing happens...,or exactly put 32M?
|
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)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.