file-4.10 mime_content_type() return 'text/plain' only file-4.09 ok. Reproducible: Always Steps to Reproduce: 1. 2. 3.
I have the same problem with file-4.10-r1 and mod_php-5.0.2. file-4.09 works fine with mod_php. file-4.10-r1 alone works fine too. Maybe mod_php cannot parse the new file as mod_php says "invalid magic file, disabled" in output of phpinfo(). For case it can help here is the diff for magic.mime file: $ diff /usr/share/misc/file/magic.mime magic.mime-4.10-r1 13a14,93 > # Real Audio (Magic .ra\0375) > 0 belong 0x2e7261fd audio/x-pn-realaudio > 0 string .RMF application/vnd.rn-realmedia > > #video/x-pn-realvideo > #video/vnd.rn-realvideo > #application/vnd.rn-realmedia > # sigh, there are many mimes for that but the above are the most common. > > # Taken from magic, converted to magic.mime > # mime types according to http://www.geocities.com/nevilo/mod.htm: > # audio/it .it > # audio/x-zipped-it .itz > # audio/xm fasttracker modules > # audio/x-s3m screamtracker modules > # audio/s3m screamtracker modules > # audio/x-zipped-mod mdz > # audio/mod mod > # audio/x-mod All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z) > > # Taken from loader code from mikmod version 2.14 > # by Steve McIntyre (stevem@chiark.greenend.org.uk) > # <doj@cubic.org> added title printing on 2003-06-24 > 0 string MAS_UTrack_V00 > >14 string >/0 audio/x-mod > #audio/x-tracker-module > > #0 string UN05 MikMod UNI format module sound data > > 0 string Extended\ Module: audio/x-mod > #audio/x-tracker-module > ##>17 string >\0 Title: "%s" > > 21 string/c !SCREAM! audio/x-mod > #audio/x-screamtracker-module > 21 string BMOD2STM audio/x-mod > #audio/x-screamtracker-module > 1080 string M.K. audio/x-mod > #audio/x-protracker-module > #>0 string >\0 Title: "%s" > 1080 string M!K! audio/x-mod > #audio/x-protracker-module > #>0 string >\0 Title: "%s" > 1080 string FLT4 audio/x-mod > #audio/x-startracker-module > #>0 string >\0 Title: "%s" > 1080 string FLT8 audio/x-mod > #audio/x-startracker-module > #>0 string >\0 Title: "%s" > 1080 string 4CHN audio/x-mod > #audio/x-fasttracker-module > #>0 string >\0 Title: "%s" > 1080 string 6CHN audio/x-mod > #audio/x-fasttracker-module > #>0 string >\0 Title: "%s" > 1080 string 8CHN audio/x-mod > #audio/x-fasttracker-module > #>0 string >\0 Title: "%s" > 1080 string CD81 audio/x-mod > #audio/x-oktalyzer-tracker-module > #>0 string >\0 Title: "%s" > 1080 string OKTA audio/x-mod > #audio/x-oktalyzer-tracker-module > #>0 string >\0 Title: "%s" > # Not good enough. > #1082 string CH > #>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data > 1080 string 16CN audio/x-mod > #audio/x-taketracker-module > #>0 string >\0 Title: "%s" > 1080 string 32CN audio/x-mod > #audio/x-taketracker-module > #>0 string >\0 Title: "%s" > > # Impuse tracker module (it) > 0 string IMPM audio/x-mod > #>4 string >\0 "%s" > #>40 leshort !0 compatible w/ITv%x > #>42 leshort !0 created w/ITv%x > 17a98,110 > # xml based formats! > > # svg > > 0 string \<?xml > # text/xml > >38 string \<\!DOCTYPE\040svg image/svg+xml > > > # xml > 0 string \<?xml text/xml > > 63a157,158 > > 103c198 < 0 string OggS audio/ogg --- > 0 string OggS application/ogg 386a482,493 > # CDROM Filesystems > 32769 string CD001 application/x-iso9660 > > # Newer StuffIt archives (grant@netbsd.org) > 0 string StuffIt application/x-stuffit > #>162 string >0 : %s > > # BinHex is the Macintosh ASCII-encoded file format (see also "apple") > # Daniel Quinlan, quinlan@yggdrasil.com > 11 string must\ be\ converted\ with\ BinHex\ 4 application/mac-binhex40 > ##>41 string x \b, version %.3s > 790a898,907 > > # Danny Milosavljevic <danny.milo@gmx.net> > # this are adrift (adventure game standard) game files, extension .taf > # depending on version magic continues with 0x93453E6139FA (V 4.0) > # 0x9445376139FA (V 3.90) > # 0x9445366139FA (V 3.80) > # this is from source (http://www.adrift.org.uk/) and I have some taf > # files, and checked them. > #0 belong 0x3C423FC9 > #>4 belong 0x6A87C2CF application/x-adrift
Anything new? I have the same problem with file-4.12.
Just a workaround - I have set path to the Apache magic file for mod_php and this works.
I had to additionally enable mime_magic.debug to get it working. Now I at least get some detailed warnings: PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:47) '!SCREAM! audio/x-mod' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:104) 'image/svg+xml' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:187) 'AVI video/x-msvideo' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:614) 'jP image/jp2' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:619) 'jp2 image/jp2' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:622) 'M4A audio/mp4' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:623) 'qt video/quicktime' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:686) 'Hierarchical Data Format (version 4) data' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:687) 'Hierarchical Data Format (version 5) data' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:762) 'public key block' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:763) 'message' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:764) 'signed message' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:765) 'signature' is not a valid mimetype, entry skipped in Unknown on line 0 PHP Warning: PHP Startup: : (/usr/share/misc/file/magic.mime:766) 'data' is not a valid mimetype, entry skipped in Unknown on line 0 I've set mime_magic.magicfile to "/usr/share/misc/file/magic.mime". I'm using sys-apps/file-4.12 and dev-php/php-5.0.3
looks like a php bug then ... it cant handle the new file formats once you comment out all the mimetype's php complains about, it 'works': mime_magic support => enabled
anybody want to take a stab at updating PHP to handle the newer mime format file?
*** Bug 62357 has been marked as a duplicate of this bug. ***
*** Bug 62393 has been marked as a duplicate of this bug. ***
(In reply to comment #6) > anybody want to take a stab at updating PHP to handle the newer mime format file? PHP requires the Apache mime magic file *NOT* the file one (see http://php.net/manual/en/ref.mime-magic.php). That is the reason for this bug, the ebuild just needs updating to use the apache magic instead of the file one.
Hi, mime_content_type() is deprecated in preference to the pecl-fileinfo package. We've decided to drop support for mime_content_type(). Best regards, Stu