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.

3
  • 2
    have you examined what phpinfo returns? Jan 17, 2013 at 13:32
  • 1
    @Peter Wooster Thanks, it turns out it was using a php.ini file in the apache/bin directory, and not the logical one found in php... Jan 17, 2013 at 13:37
  • i've added this as an answer so others can find it, you should change the title to reference the problem with the wrong php.ini. I could edit it, but I'll leave that to you. Jan 17, 2013 at 13:42

6 Answers 6

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.

1
  • Thanks a lot for pointing out that running info.php containing <?php phpinfo(); ?> will give the location of the php.ini file actually used rather than the one use in cli. Jan 14, 2022 at 0: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. :)

1
  • Confirmed for Wamp 3.1.9 !
    – Aakash
    Nov 12, 2019 at 5:41
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.

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

1
  • This is what I was missing, here I was just restarting apache like a dumbass :) thanks! Jun 26, 2020 at 14:44
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.
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.

1
  • 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. Nov 26, 2018 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.