0

I couldn't upload files more than 2Mb to the server at first. After editing the .htaccess, increasing "upload_max_filesize", I've maxed it up more than 2 Mb but the problem is I can't upload files more than 5Mb. How can I upload files more than 5Mb?

amit biswas
  • 75
  • 1
  • 3
  • 7

2 Answers2

2

Same answer as above just using the ini_set() instead

<?php
 ini_set('upload_max_filesize', '40M');
 ini_set('post_max_size', '40M');
  • Note that this will only work in PHP <= 4.2.3. In further versions, those directives have a changeable mode of PHP_INI_PERDIR (see here for definitions : http://www.php.net/manual/en/configuration.changes.modes.php) – Jonathan Bergeron Aug 31 '17 at 12:31
1

May be you are looking for this answers: PHP change the maximum upload file size

You need to set the value of upload_max_filesize and post_max_size in your php.ini :

; Maximum allowed size for uploaded files.
upload_max_filesize = 40M

; Must be greater than or equal to upload_max_filesize
post_max_size = 40M

After modifying php.ini file(s), you need to restart your HTTP server to use new configuration.

If you can't change your php.ini, you're out of luck. You cannot change these values at run-time; uploads of file larger than the value specified in php.ini will have failed by the time execution reaches your call to ini_set.

Community
  • 1
  • 1
S M Iftakhairul
  • 1,120
  • 2
  • 19
  • 42