mr_than mr_than - 6 months ago 102
MySQL Question

phpMyAdmin doesn't load database import file with unsupported compression (application/gzip)

I upgraded from an older lubutu release to 14, now running PHP 5.5 and phpMyAdmin 4.0.10deb1, I regularly move small MySQL database exports between hosts (700KB gzip, around 7-10MB decompressed SQL).


You attempted to load file with unsupported compression (application/gzip). Either support for it is not implemented or disabled by your configuration.


This was all working swimmingly on the older PHP setup, I'm not sure if it's a mime type thing or a configuration issue.

I can provide detailed phpinfo() dumps, but zlip is there, phar, etc:

Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip

Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, tls

Registered Stream Filters zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk


The gzipped sql files aren't corrupt, they decompress and load manually without issue. If there's some configuration setting you can suggest I'll try that out

Answer

Thanks for all the comments, looking around some of the links I the issue is the Debian/Ubuntu choice of zlib providing the php function gzopen64 rather than the expected gzopen, solution outlined here: http://kb.parallels.com/en/116645

/usr/share/phpmyadmin/import.php provides the following, changing gzopen to gzopen64 fixes the issue

        case 'application/gzip':
        if ($cfg['GZipDump'] && @function_exists('gzopen')) {
            $import_handle = @gzopen($import_file, 'r');
        } else {
            $message = PMA_Message::error(
                __('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.')
            );
            $message->addParam($compression);
            PMA_stopImport($message);
        }
        break;