|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56958 FileInfo Error
Submitted: 2006-04-13 11:53 UTC Modified: 2006-04-24 15:35 UTC
From: nimshon at gmail dot com Assigned:
Status: Not a bug Package: Fileinfo (PECL)
PHP Version: 5.1.0 OS: FreeBSD 6.0 i386
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nimshon at gmail dot com
New email:
PHP Version: OS:


 [2006-04-13 11:53 UTC] nimshon at gmail dot com
Error in the Fileinfo Package, can't use it...
(I have php 5.1.2 but it doesn't appear in the versions list)

Reproduce code:
$finfo = finfo_open(FILEINFO_MIME); // return mime type ala mimetype extension
foreach (glob("*") as $filename) {
   echo finfo_file($finfo, $filename) . "\n";

(Taken from the manual )

Expected result:
i expected the page to display the mimetypes of the files in the script's dir

Actual result:
Warning: finfo_open() [function.finfo-open]: Failed to load magic database at ''. in /usr/home/http/html/fileinfo.php on line 10

Warning: finfo_file(): supplied argument is not a valid file_info resource in /usr/home/http/html/fileinfo.php on line 13



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-13 12:38 UTC]
(wrong package)
 [2006-04-13 13:06 UTC] nimshon at gmail dot com
what do you mean "wrong package" ? i found it on this website !
 [2006-04-14 08:29 UTC]
Sorry, this means that fileinfo didn't find your magic.mime database at build time, specify the path to it in the second argument to finfo_open().
 [2006-04-24 15:35 UTC] nimshon at gmail dot com
but I dont know the path to it :(
how can I know?
 [2006-09-27 09:54 UTC] florin dot cojocarut at gmail dot com
I have already done what 'mike at php dot net' said and the error still the same. 
Someone said, that in php 5.1.4 we must give the path to "magic.mime" file without extension as "X:/path/to/extras/magic". Looks like it works, but when I used it, the finfo_file function return only one type of file from "magic.mime" database for all tested files.
Anyone could help with a older version of php_fileinfo.dll compiled for php 5.1.4???
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 12:01:33 2024 UTC