How to increase phpmyadmin upload file size

I am not able to change the file size that phpmyadmin accepts for importing databases on my test server.

I have changed all values I have some idea about in my.cnf:

max_packet_size
Key_buffer

or the upload file size and max_post_size value in every php.ini file I have found on the system.

The accepted file size on the import screen still remains 8,192kib.


Solution 1:

To increase MySQL phpmyadmin import file size in Ubuntu 16.04 or newer, follow these steps. In the newest Ubuntu version you can have either PHP 5 or PHP 7.

Step - 1: open php.ini of the appropriate PHP version(s).

  • For PHP v5.0

    sudo -H gedit /etc/php5/apache2/php.ini
    
  • For PHP v7.0

    sudo -H gedit /etc/php/7.0/apache2/php.ini
    
  • For PHP v7.1

    sudo -H gedit /etc/php/7.1/apache2/php.ini
    
  • For PHP v7.2

    sudo -H gedit /etc/php/7.2/apache2/php.ini
    
  • For PHP v7.3

    sudo -H gedit /etc/php/7.3/apache2/php.ini
    

Step - 2: Now need to increase below parameters in the php.ini file.

memory_limit = 1500M

post_max_size = 1500M

upload_max_filesize = 1500M

Please Note : post_max_size should be larger than upload_max_size

Step - 3: Now you need to restart your apache server to effect changes.

sudo service apache2 restart

Solution 2:

The first things to check (or ask your host provider to check) are the values of max_execution_time, upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. All of these three settings limit the maximum size of data that can be submitted and handled by PHP.

Please note that post_max_size needs to be larger than upload_max_filesize.

Solution 3:

  1. create info.php page and check all details about file

    <?php 
      phpinfo();
    ?>
    
  2. run in your browser search upload_max_filesize and post_max_size change by default value 2M to 80M.

  3. Run

    sudo -H gedit /etc/php5/apache2/php.ini
    
  4. change both values upload_max_filesize and post_max_size
    change by default value 2M to 80M

  5. Restart apache

    sudo /etc/init.d/apache2 restart