|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56922 Wrong magic path
Submitted: 2006-03-28 03:31 UTC Modified: 2006-11-07 16:28 UTC
From: uros at sir-mag dot com Assigned:
Status: Closed Package: Fileinfo (PECL)
PHP Version: 5.1.1 OS: FreeBSD
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: uros at sir-mag dot com
New email:
PHP Version: OS:


 [2006-03-28 03:31 UTC] uros at sir-mag dot com
I install this module on FreeBSD and have problem locating magic database. I check config.m4 and found that 

  MAGIC_MIME_LOCATIONS="/usr/local/share/file/magic /usr/share/file/magic /usr/share/misc/file/magic /etc/magic /usr/share/misc"

is wrong. The last one need to be /usr/share/misc/magic


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-23 17:17 UTC] zaa at zaa dot pp dot ru
You may try this patch (it has already been posted in a PR to FreeBSD GNATS system):

diff -urbBNp pecl-fileinfo.orig/files/patch-config.m4 pecl-fileinfo/files/patch-config.m4
--- pecl-fileinfo.orig/files/patch-config.m4    Thu Jan  1 03:00:00 1970
+++ pecl-fileinfo/files/patch-config.m4 Wed May 24 00:56:28 2006
@@ -0,0 +1,22 @@
+--- config.m4.orig     Wed May 24 00:48:38 2006
++++ config.m4  Wed May 24 00:51:24 2006
+@@ -47,12 +47,15 @@ if test "$PHP_FILEINFO" != "no"; then
+     -L$FILEINFO_DIR/lib
+   ])
+-  MAGIC_MIME_LOCATIONS="/usr/local/share/file/magic /usr/share/file/magic /usr/share/misc/file/magic /etc/magic /usr/share/misc"
+-  for i in $MAGIC_MIME_LOCATIONS; do
+-    if test -f $i; then
++  MAGIC_MIME_DIRS="/usr/local/share/file /usr/share/file /usr/share/misc/file /etc /usr/share/misc"
++  MAGIC_MIME_FILENAMES="magic magic.mime"
++  for i in $MAGIC_MIME_DIRS; do
++      for j in $MAGIC_MIME_FILENAMES; do
++              if test -f "$i/$j"; then
++                      PHP_DEFAULT_MAGIC_FILE="$i/$j"
+        break
+     fi
++      done
+   done
 [2006-11-07 16:28 UTC] ilia at prohost dot org
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 04:01:30 2024 UTC