How to Increase File Import Size and PHP Limit in XAMPP/WAMP
Last month I was trying to upload a big new paper site to rebuild, SQL file size was 4MB, I was not aware XAMPP’s default SQL upload size is 2MB, problem! Got a good solution for it to increase file import size. I am sure this is a very common facing many developers, I am going to relief them, it’s very simple but effective. While I was trying to upload 4MB size SQL, which was showing this error message:
“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. See FAQ 1.16.”
File upload size was 2MB
Increase File Import Size and PHP Limit in XAMPP/WAMP using php.ini
We have to search php.ini file first, I am using XAMPP so showing you mainly it, please try on WAMP, these are more or less same. Many people telling this php.ini will be found on C:\xampp\apache\bin\php.ini but I am getting it on C:\xampp\php\php.ini find these folders or search on file explorer.
Open that php.ini file and search for upload_max_filesize
;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. ; http://php.net/file-uploads file_uploads=On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ; http://php.net/upload-tmp-dir upload_tmp_dir="C:\xampp\tmp" ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize=56M ; Maximum number of files that can be uploaded via a single request max_file_uploads=20
Default is 2M, increase as needed, I made it 56M
Then search for post_max_size this should be greater than upload_max_filesize. You know this is maximum, so this should be same or greater than normal.
; Maximum size of POST data that PHP will accept. ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. ; http://php.net/post-max-size post_max_size=128M
Default is 8M, increase it greater than upload_max_filesize, Otherwise phpMyAdmin will not allow you to upload more than 8MB, I made it 128M.
Increase PHP Limit in XAMPP/WAMP using php.ini
Using same method above search php.ini file, open it and search for memory_limit
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit=1024M
Its default value is 128M, increase it as needed, I made it 1024M.
Alternatively you can use MySql client program always. To upload large file you can use
mysql -h hostname -u username -p databasename < wordpress.bak.sql
That can ask your password, enter your password and press enter.
Don’t forget restart you XAMPP/WAMP after doing these, if you could not find restart button, no problem restart your computer and check the effects. Enjoy! If you face any problem, don’t be shy, feel free to ask me.