12

I am using Wampserver (32 bits & PHP 5.5) 2.5. phpmyadmin inside of it is allowing me to import database of max 128mib and execution time is low.

In WAMPServer 2.5 the PHP limits applied to phpMyAdmin can be found in this file \wamp\alias\phpmyadmin.conf

The question is that i am unaware about the values insert. I want to upload a file of 5GB. I have changed the values in relevant file and values are also changed in that file as well as phpmyadmin but when i import my 5GB file it gave me following error on phpmyadmin.

"You probably tried to upload a file that is too large. Please refer to documentation for a workaround for this limit."

Can someone please help me about the parameters value that i should insert in below parameters for 5GB file to import in wamp???

php_admin_value upload_max_filesize **??**
php_admin_value post_max_size **??**
php_admin_value max_execution_time **??**
php_admin_value max_input_time **??**
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
djsaiim
  • 121
  • 1
  • 1
  • 3

4 Answers4

26

With a database backup file that big it would be easier to use the MYSQL Console to restore this database. It does not have any of the size and runtime limitations that a php script does.

Using the wampmanager icon in the system tray you do this

wampmanager -> MYSQL -> MYSQL Console

click the MYSQL Console menu and it will run mysql.exe in a command windows.

It will challenge you for the root password first, so if you have not changed that MYSQL accounts password just hit enter

If you have changed the root password enter the password and hit Enter

Now at the mysql> command prompt enter

source C:/path/to/your/backup.sql

And mysql will run the restore for as long as it takes to complete the restore


If you must use phpMyAdmin then you will need to amend the correct configurations to do that.

The phpMyAdmin alias contains these parameters for this very purpose and of course will override the standard php.ini setting of these parameters. Afterall you dont want to amend the php.ini for a restore you will only run maybe once, and affect the whole PHP environment permanantly.

The phpMyAdmin config can be found in \wamp\alias\phpmyadmin.conf

Alias /phpmyadmin "D:/wamp/apps/phpmyadmin4.7.0/"

<Directory "D:/wamp/apps/phpmyadmin4.7.0/">
    Options Indexes FollowSymLinks MultiViews
  AllowOverride all
  <ifDefine APACHE24>
        Require local
    </ifDefine>
    <ifDefine !APACHE24>
        Order Deny,Allow
        Deny from all
        Allow from localhost ::1 127.0.0.1
    </ifDefine>

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

All you need to do is increase the relevant values, so for example you could try these

  php_admin_value upload_max_filesize 5128M
  php_admin_value post_max_size 5256M
  php_admin_value max_execution_time 600
  php_admin_value max_input_time 600
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • The only real way to import big files! BTW, on WAMP server 3.0.6, I used to change all three properties: memory_limit, post_max_size and upload_max_filesize then restarted all services, but nothing happens. It still shows 128MB, which was not true even initially, as I had upload_max_filesize = 2M in the php.ini file, so I suppose there is something wrong with the WAMP server/phpmyadmin itself, as on my Linux machine I have no such problems with the same version of phpmyadmin. – Nikolay Ivanov Feb 23 '17 at 09:54
  • 1
    @NikolayIvanov The limits applied to phpMyAdmin in WAMPServer are set by the Alias for phpMyAdmin in `wamp\alias\phpmyadmin.conf` The conf file overrides the `php.ini` setting as I am sure you realise. Check it out. Nothing wrong with WAMPServer if you know what you are doing – RiggsFolly Feb 23 '17 at 09:57
15

Go to your Wamp installed directory and follow the below steps and open the “phpmyadmin.conf” file

<wamp_dir>/alias/phpmyadmin.conf

You will see the below code in the end of the file :

# To import big file you can increase values
php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360

Replace it with the given code :

# To import big file you can increase values
php_admin_value upload_max_filesize 1024M
php_admin_value post_max_size 1024M
php_admin_value max_execution_time 1800
php_admin_value max_input_time 1800

Now you can upload large size of the files in the Wamp phpmyadmin.

I have taken inspiration from this post : http://www.codecanal.com/increase-the-database-upload-size-in-wamp-server/

Shown Marsh
  • 391
  • 3
  • 7
6

You need to increase following values in php.ini file and restart the WAMP Server

memory_limit
post_max_size
upload_max_filesize

Make sure the value of upload_max_filesize is smaller than post_max_size.

Hop this helps.

Faizan Younus
  • 793
  • 1
  • 8
  • 13
  • 1
    I have 5GB of sql file which i want to import in wamp but the limit is 128MB. Can you please brief me about all parameters. – djsaiim Jul 27 '16 at 07:34
  • 2
    The values in `php.ini` are overridden by the settings in `\wamp\alias\phpmyadmin.conf` so this will not increase the allowed limits within `phpMyAdmin` – RiggsFolly Feb 27 '18 at 11:10
2

you have to increase upload size from php

ini_set('post_max_size', '128M');
ini_set('upload_max_filesize', '128M');

and also you can set with php.ini

post_max_size = 128M
upload_max_filesize = 128M
Bhavik Hirani
  • 1,996
  • 4
  • 28
  • 46