Many bloggers and developers who create PHP applications rely on web development platforms like WAMPServer or XAMPP to create, test and debug applications before releasing them publicly. Testing web applications locally (on our computer) is very important because it gives us a chance to rectify problems before others point it, especially your boss or an end-user.
After a recent OS reinstall I was installing wordpress locally using WampServer and I was in a phase where I have to import my existing database. My database is around 10 MB, but when I went to import it using phpMyAdmin (a module of WampServer) there I found that upload/import file size limit was set to 2 MB. But, here I want to import a 10 MB database, so, I started to look for workarounds and started with the php.ini file that is found in WampServer (C:\wamp\bin\php\php5.3.13\php.ini). I remember that previously I fixed this issue by changing few values in that php.ini file. But, this time the changes I made are not being reflected and the file size limit was stuck at 2 MB only.
I don’t know what mistake I was doing, so I started to search again for possible solutions and this time I found an interesting thing. I found another php.ini, that is located inside apache folder (C:\wamp\bin\apache\apache2.2.22\php.ini). So, may be phpMyAdmin is making use of this php.ini file rather than the file that is located insider php folder. So, I opened this php.ini configuration file located in apache folder and selected this line:
upload_max_filesize = 2M
and changed it to this :
upload_max_filesize = 20M
Now, I restarted All Services of WampServer by clicking the systray icon and then tried to import the database file. But, this time even though the limit was changed, it didn’t changed according to the value given. We gave 20M as the limit but it showed me the limit as 8M. So, I went back and opened the php.ini configuration file found in apache folder and then selected this line:
post_max_size = 8M
and changed it to:
post_max_size = 20M
Now, the database import file size was changed to 20M and hence I was able to import my 10MB database successfully. So, if you are my situation where the size of your database is exceeding the file size limit, then change the above two lines according to your requirements i.e. change value ’20’ to the required value. Also, make sure that the value of post_max_size is greater than or equal to the value of upload_max_filesize, because phpMyAdmin will consider the lowest of these two values as the import file size limit.