[tab:Scenario]I’m currently working on developing a Business Information Manager using the EPESI BIM framework. It means ALOT of backups in between changes as I don’t use a repository. Its a simple “backup the database and page I’m working on” type scenario. What this means though is that Im constantly faced with Export/Import of SQL files.
This post exists because, as is often the case, I have broken the app I’m working on, and I need to restore the previous instance of it. The database however is over 6mb and php by default will only allow a 2mb upload.
True I could just use terminal to do it, or MySQL Administrator and paste the SQL dump straight into that (my usual preferred method) however I was curious to know how to kill the annoying “sorry can’t do it” attitude of my server.
If you click on the solution tab, you’ll see how to change the maximum file upload size so that you don’t get a “No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration” error when using phpmyadmin.
[tab:Solution]
In order to change the maximum file upload size, you need to edit the php.ini.
LOCATION: mine is located in
/etc/php5/apache2/php.ini
If you cannot find it simply use the locate command by typing
locate php.ini
You should see a list of locations for this file, choose the one that resides inside of the /etc directory tree and the php folder corresponding to your version of php.
find the line:
; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 2M
and change it to suit your needs. If your server is not a production server, and it is server to the world, keep in mind that you do not want people to have the ability to max out your server by having too large a file size listed here.
Now restart your server:
service apache2 restart
Log in to phpMyAdmin and all should be well.
[tab:END]
Leave a Reply