4
votes

When I try upload database (794 kb) I have error:

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.

I have read many answer for this error but I can not find and decision and answers that works for me.

My server:

Ubuntu 12.10 Server

Apache/2.2.22 ( apache2-mpm-itk);

MySQL client version: 5.5.27;

phpmyadmin 3.4.11.1deb1;

nginx/1.2.1;

PHP 5.4.6;

Configuration phpmyadmin in /etc/nginx/default

 location /phpmyadmin {

                root /usr/share/phpmyadmin;
                index index.php;

                proxy_pass http://backend/phpmyadmin;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_connect_timeout 120;
                proxy_send_timeout 120;
                proxy_read_timeout 180;

}

php.ini config

file_uploads = On
upload_tmp_dir = /var/tmp
upload_max_filesize = 128M
max_file_uploads = 30
post_max_size = 128M

Thank you!

4
if you do not select your file through browse button in phpmyadmin,you'll get this message. is it your case? - Amir
check if your temp folder had write access from php - raidenace
@Amir no, I select file through browse button in phpmyadmin, and when I submit, I have this error. - denys281
@Raidenace I made chmod -R 777 /var/lib/phpmyadmin/tmp/ and all works, but I don't now if it is good practice and if it is secure. - denys281
@denys281 - Usually tmp folders do have relaxed permissions because they are just transient placeholders of data. Having said that, if you are working in local host that is fine. In server side, the permissions for such directories will be correctly set up by sys admins. Am glad it helped fix your issue.. - raidenace

4 Answers

5
votes

Thanks @denys281, that helped me:

chmod -R 777 /var/lib/phpmyadmin/tmp
2
votes
chown apache-user /var/lib/phpmyadmin/tmp

Replace apache-user with the user configured in /etc/apache2/envvars. Look for these settings:

export APACHE_RUN_USER=apache-user
export APACHE_RUN_GROUP=apache-group

That way you will give permissions for the user running on the web server access to the temp directory, without making it 777 (open to all users).

0
votes

decrease the "upload_max_filesize = 128M" by 1 MB or so . this trick will work

0
votes

In my base php.ini configuration I had disabled file_uploads and limited the upload size so then on for each vhost these values are modified if need be.

PMA uses its own apache configuration which is found at:

/etc/phpmyadmin/apache.conf

So to enable file uploads with a 10Mb file size limit, I edited the file like this:

<Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php

    # Enable File loads if required
    php_admin_flag file_uploads On
    php_admin_flag post_max_size 10M
    php_admin_flag upload_max_filesize 10M

    <IfModule mod_php5.c>
    ...
    </IfModule>
    <IfModule mod_php.c>
    ...
    </IfModule>
</Directory>

Don't forget to reload the Apache server configuration:

Ubuntu < 16.04

service apache2 reload

Ubuntu = 16.04

systemctl reload apache2