|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56270 Build error os x
Submitted: 2005-01-18 19:03 UTC Modified: 2005-04-06 03:55 UTC
From: mike at lismal dot ch Assigned:
Status: Closed Package: Fileinfo (PECL)
PHP Version: 5.0.3 OS: os x
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
38 + 2 = ?
Subscribe to this entry?

 [2005-01-18 19:03 UTC] mike at lismal dot ch
Build error  os x

Reproduce code:
Building this package on os x with pear results in 
following error:

checking for PHP extension directory... /usr/local/php5/
checking for re2c... exit 0;
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for fileinfo support... yes, shared
checking for magic files in default path... not found
configure: error: Please reinstall the libmagic 
`/private/tmp/tmpbTlPl7/Fileinfo-0.2/configure' failed

I installed libmagick via fink


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-20 04:30 UTC] mike at lismal dot ch
im using os x 10.3.7
 [2005-01-28 04:09 UTC] martinh at solid-state-logic dot com
Surprisingly this doesn't work on FreeBSD 5.3 either. I say surprisingly as MacOS 10.5 and FBSD 5.3 share alot of the same code base.

If you need any help with this please let me know.
 [2005-01-28 05:37 UTC] martinh at solid-state-logic dot com
In FreeBSD 5.3 (and most like Mac OS 10.3) the magic file is not in /etc/, but /usr/share/misc.

The config file needs altering to reflect this change.

(I just sym linked the two to get it to compile)
 [2005-04-05 11:12 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.

 [2005-04-06 03:55 UTC] mike at lismal dot ch
to get fileinfo to compile on os x you must install the 
file-shlibs and file-dev
otherwise libmagic won't be found

also when loading the extension in a script:
don't use
dl('fileinfo.' . PHP_SHLIB_SUFFIX);
 [2005-10-19 15:13 UTC] chartjes at gmail dot com
I tried building fileinfo on my iBook using 'pecl install 
fileinfo' and still get the same 'please reinstall libmagic 
distribution' message.

I installed imagemagick via fink, along with file-shlibs and 
files-dev like previous messages indicated.  Don't know how to 
get the fileinfo configure script to look at /sw/ (where fink 
installed stuff) to look for the magic files.
 [2007-11-30 12:42 UTC] taylorbarstow at gmail dot com
This is still a problem for Mac OS X users (Fileinfo 1.0.4, OS X 10.4.11).  The fix (below) is to alter the configure script, but there should be away to do this from the command line.

The quick workaround is to edit the configure script; on line 3218, where it reads:

  SEARCH_PATH="/usr/local /usr /usr/share/file"

change it to read:

  SEARCH_PATH="/usr/local /usr /usr/share/file /sw"

It would be a lot better if the package maintainer could change the configure script to accept a --with-libmagic directive, so OS X users could do:

  # ./configure --with-libmagic=/sw

 [2008-09-01 22:50 UTC] abajay at netzero dot com
Install Fink
sudo apt-get install file-shlibs
sudo apt-get install file-dev

sudo pecl  install fileinfo
#this will fail with an error
go to the pear/temp/download/fileinfo directory
edit the configure file
	add /sw to SEARCH_PATH
sudo make install

restart apache
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 12:01:29 2024 UTC