|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57859 finfo_file will not return mime-type
Submitted: 2007-10-02 05:19 UTC Modified: 2020-11-15 04:22 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: online at patrick-brueckner dot de Assigned: cmb (profile)
Status: No Feedback Package: Unknown/Other Function
PHP Version: 5.2.1 OS: Linux 2.6.20 / Ubuntu 7.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-10-02 05:19 UTC] online at patrick-brueckner dot de
The below code does not return a mimetype string but an identify-like output.

Reproduce code:
$oFinfo = finfo_open(FILEINFO_MIME);
echo finfo_file($oFinfo,"/home/paddy/Firefox_wallpaper.png");

Expected result:

Actual result:
PNG image data, 400 x 264, 8-bit/color RGB, non-interlaced


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-23 10:24 UTC] php at kingsquare dot nl
A possible answer to this bug lies in the inability to load a non standard mime.magic file.
(see bug #9798)

the problem below can be fixed using this (and only this) extra paramter in the finfo_open() call:
finfo_open(FILEINFO_MIME, '/usr/share/file/magic');

BUT, copying the magic file OR using a different file will not work:
finfo_open(FILEINFO_MIME, '/some/other/location');

on Debian (or Ubuntu) systems the default magic file (which ever that may be) is apperntly not used nor is a error given about not being able to open the magic database.
 [2020-11-03 16:28 UTC]
-Status: Open +Status: Feedback -Package: Fileinfo +Package: Unknown/Other Function -Assigned To: +Assigned To: cmb
 [2020-11-03 16:28 UTC]
Does that still happen with any of the actively supported PHP
versions[1]?  If so, please provide the file which triggers the
unexpected behavior for download.

[1] <>
 [2020-11-15 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 06:01:33 2024 UTC