How to increase the maximum upload size on website

How to increase the maximum upload size on website

May 4, 2018 | PHP

In this tutorial, we will show you how to increase the maximum file upload size using three types of methods.
  1. Website Functions File
  2. Create or Update an existing PHP.INI File
  3. htaccess Method

1: Website Functions File

There are cases where we have seen that just by adding the following code in the website function’s file, you can increase the upload size:
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

2. Create or Update an existing PHP.INI File

Mostly you will not see a php.ini file in your directory of hosting panel. If you do not see one, then create a new file called php.ini and upload it in the root folder (public_html)). with the following code:
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

3. htaccess Method

This time many people have tried using the htaccess method where by modifying the .htaccess file in the root directory, you can increase the maximum upload size in website. Open or Update an existing .htaccess file in the root folder and add the following code:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
To verify that the new php configurations is active, create a PHP test file that contains the following code in the directory:
<?php phpinfo(); ?>
As you learned about how to increase maximum execution file size & time using three types of method. It is always work properly if any condition it is not working with your website. In this case you would have to ask your hosting service provider for support.
Being Idea is a web platform of programming tutorials to make better programming skills and provides Software Development Solutions.

0 Comments

Leave a Reply