15

I have recently reinstalled my server this time with WAMP, previously I was using XAMPP.

In phpmyadmin the max upload size for database files is at 2,048kb.

I have changed the three variables in php.ini according to several forums and articles on the problem, restarted my server and it has no effect what so ever.

Is there some kind of environmental path variable etc that needs setting elsewhere?

What am I missing.

imperium2335
  • 23,402
  • 38
  • 111
  • 190

6 Answers6

23

Put these in php.ini

upload_max_filesize = 10M
post_max_size = 10M

Or you can put these in .htaccess:

php_value upload_max_filesize 10M
php_value post_max_size 10M

Replace 10M with anything you want.

Extra: To find what php.ini is currently used, create a file in the web root, let's say info.php that contains <?php phpinfo();. Then access that file from your browser, and search for php.ini. This has to be done through the browser, from the command line you will see the php.ini used in cli.

When finished, restart Apache for the changes to take effect.

Vlad Preda
  • 9,780
  • 7
  • 36
  • 63
  • Thanks a lot for pointing out that running info.php containing will give the location of the php.ini file actually used rather than the one use in cli. – Spherical Cowboy Jan 14 '22 at 00:42
15

First you have to change values in php.ini file as per your requirements.

post_max_size = 1024M 
upload_max_filesize = 1024M 
max_execution_time = 3600
max_input_time = 3600 
memory_limit = 1024M 

Note - Change these values carefully. These values will impact for all of your projects of that server.

Now, If all above solutions are not working, kindly check your phpmyadmin.conf file. If you are using WAMP so you can find the file in "C:\wamp64\alias".

You have to change below values.

Values already in file are -

  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

Change above code to -

#  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

Now just restart your server, to work with changed values. :)

7

The php.ini may not be the one you expect. Be sure to check phpinfo to see what config is being used and which parameters are active.

Peter Wooster
  • 6,009
  • 2
  • 27
  • 39
5

Another lead : If you use PHP FPM, you need to restart the fpm service after setting values in php.ini. On debian based systems :

service php7.3-fpm restart

Gaëtan Trema
  • 51
  • 1
  • 1
3

We need to increase the maximum file size value in php.ini file, By default, the upload_max_filesize is set to 2MB in XAMPP

To resolve this problem:

  • We need to locate where the php.ini file is. in Xampp, it is found in C:\xampp\php.

  • Open the php.ini file, search for “upload_max_filesize” and replace the 2M (meaning 2-Megabyte) to a higher value, say 50M.

change: upload_max_filesize =2M

to: upload_max_filesize =50M

  • Restart Apache for the change to take effect.
Cristiana Chavez
  • 11,349
  • 5
  • 55
  • 54
3

This drove me insane but I found that WAMPServer has a file in alias/phpmyadmin.conf that I needed to make the changes in.

stardust4891
  • 2,390
  • 1
  • 18
  • 30
  • 1
    The OP clearly knows how to change the value to what he desires, he is simply unsure of where to do so. I faced the exact same issue, and found that WAMP has a seperate configuration file for phpmyadmin. The fact that I actually have to type this out to explain myself is a testament to how stupid things have become on this website. – stardust4891 Nov 26 '18 at 21:01