How to increase upload size in php?

Asked

Viewed 388 times

1

Good morning, I need to upload a csv file that is larger than the standard php that is 2M (the file is around 10 to 15M) The application works perfectly for files smaller than 2MB.

I’ve tried in every way to push that limit and I couldn’t. Somebody help me?

ini_set('upload_max_filesize', '15M');

ini_set('max_input_time', '200M');
ini_set('memory_limit', '250M');

set_time_limit(65536);

And then I echo the variable and it never changes.

  • You need to set this up right in the file php.ini of your server. According to documentation, the directive upload_max_filesize cannot be changed via ini_set.

  • It has hosting that blocks the use/creation, editing php.ini, there are services who have in their panels the option to change the upload limit there. Serious interesting to tell them to see if your case is not one of these.

1 answer

1

Locate and change in the php.ini file (in the root directory of your hosting, usually public_html) these two parameters:

post_max_size = 25M
upload_max_filesize = 25M

In case you haven’t added the lines. Have accommodations in which it is necessary to put a php.ini in the directory that will be uploaded with these parameters.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.