Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase the upload limit for files on a Symfony 2 form?

I have a form in Symfony where the user uploads files to. These files can be up to 50Mb in size.

However, when I try to upload a file that is about 10Mb (before this, the files were no bigger than 7.2Mb) the form reloads with this error:

The uploaded file was too large. Please try to upload a smaller file

This is a validation error, it doesn't appear as a proper Symfony2 error.

I've set the upload_max_filesize setting in the PHP.ini file to 50MB, so a 10MB file shouldn't be an issue?

like image 446
mickburkejnr Avatar asked Oct 17 '11 14:10

mickburkejnr


People also ask

How do I increase the PHP upload limits?

To increaes file upload size in PHP, you need to modify the upload_max_filesize and post_max_size variable's in your php. ini file. In addition, you can also set the maximum number of files allowed to be uploaded simultaneously, in a single request, using the max_file_uploads .

What is the maximum file uploading limit in PHP?

The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.


1 Answers

You need to set both of these in the php.ini:

post_max_size = 50M

upload_max_filesize = 50M
like image 72
mogoman Avatar answered Oct 13 '22 10:10

mogoman