php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #69773 Fileinfo is unable to load internal MIME database
Submitted: 2015-06-08 16:17 UTC Modified: 2016-11-24 14:54 UTC
Votes:7
Avg. Score:4.0 ± 1.1
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:0 (0.0%)
From: letynsoft at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.6.9 OS: Ubuntu 15.04 (upgraded)
Private report: No CVE-ID: None
 [2015-06-08 16:17 UTC] letynsoft at gmail dot com
Description:
------------
When i do not pass the second parameter to the new finfo() constructor (or pass NULL), it is supposed to load it's internal database but it doesn't load that. it just sais:
Warning: finfo::file(): Failed identify data 0:no magic files loaded.

It does the same, if i pass the /etc/magic.mime, but that file appears to be empty.

PS: i didn't find the PHP version in the dropdown, my PHP Version 5.6.4-4ubuntu6
PS2: I also didn't find the Fileinfo package in the 'Package Affected' dropdown (it is in the Advanced search, but not in the Report a Bug form)


Test script:
---------------
$finfo = new finfo(FILEINFO_MIME);
$mime = $finfo->file('/path/to/file');

Expected result:
----------------
it should produce the file mime type

Actual result:
--------------
Warning is thrown

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-24 14:54 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2016-11-24 14:54 UTC] ab@php.net
I don't reproduce this (anymore), also in higher versions. Feel free to reopen, if you've more details.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC