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

phpmyadmin

I tried to import data into MySQL table using phpmyadmin for a file only 11 k.
I got following message and increase upload_max_filesize, memory_limit and post_max_size , but it still does not work.

it works on my Ubuntu machine, but no Windows machines.
Are there any way to see if IIS limit the file upload or something else I can check or configure?

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

Best Answer

I am on Ubuntu 14.10 and had a similar problem. I solved it in 2 steps but it is probable solvable in one.

If you change the config.inc.php file in /etc/phpmyadmin then you will be able to have access to an upload directory of your own choice. The files will not show up under the option "Select from the web server upload directory", however. To do that you have to change the apache.conf file in the folder /etc/phpmyadmin and add your folder to the value "php_admin_value open_basedir".

On my computer it was previously:

php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/

Afterwards it read:

php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/home/user/dumps/phpmyadmin/uploaddir

This will get the file to show up under the "web server directory" option. However, if you attempt to upload the file you will probably find the error "Uploaded file cannot be moved, because the server has open_basedir enabled without access to the /var/lib/phpmyadmin/tmp directory (for temporary files).

To fix that you have to fix permissions for the directory in question, which you do with:

  • sudo chmod 777 tmp/

After making that change you will be able to upload the file in any way you want.

In other words the solution to the problem - assuming you have already allowed PHP to handle large sizes, as I had - is to make sure that you grant all permissions to the /var/lib/phpmyadmin/tmp directory.

Thanks to Ashwin BG Ranore on the thread phpMyAdmin "The directory you set for upload work cannot be reached" for making it known that one has to change php_admin_value open_basedir if one wants to have an uploadDir of one's choice.

The original poster's problem was on a Windows computer so this solution will not help him, but will help those with a similar problem on Linux computers.

Related Topic