note 85559 added to ref.fileinfo

From: Date: Fri, 05 Sep 2008 22:40:53 +0000
Subject: note 85559 added to ref.fileinfo
Groups: php.notes 
Request: Send a blank email to php-notes+get-144174@lists.php.net to get a copy of this message
This module needs some serious work. I'm a well versed linux guy and it took me almost an hour of hard research & trying this and that before I could actually get this to work. mime_content_type() is supposed to be deprecated, but if this is the replacement, stick with mime_content_type() as long as you can! After reading the previously mentioned installation issues, I still had to have this modification: $ apt-get install file-devel $ wget http://pecl.php.net/get/Fileinfo-1.0.4.tgz $ tar -zxvf Fileinfo-1.0.4.tgz $ cd Fileinfo-1.0.4 $ pecl install fileinfo Note that there is no ./configure anymore -- and that the directory name changed. Trying to do the pecl command first ended in failure. On my Fedora 7 box, I also had to directly reference the magic db as follows before this would work: $finfo = finfo_open(FILEINFO_MIME, '/usr/share/file/magic'); $mimeData = finfo_file($finfo, $file); echo "<pre>mimeData: ".print_r($mimeData, true)."</pre>"; Without it, it tries to use a linked file (/usr/share/misc/magic) -- which just doesn't work for some reason. I traced all the links, and they're right. Such basic functionality should not be so hard to come by! ---- Server IP: 209.41.74.194 Probable Submitter: 209.203.68.100 ---- Manual Page -- http://www.php.net/manual/en/ref.fileinfo.php Edit -- https://master.php.net/note/edit/85559 Del: integrated -- https://master.php.net/note/delete/85559/integrated Del: useless -- https://master.php.net/note/delete/85559/useless Del: bad code -- https://master.php.net/note/delete/85559/bad+code Del: spam -- https://master.php.net/note/delete/85559/spam Del: non-english -- https://master.php.net/note/delete/85559/non-english Del: in docs -- https://master.php.net/note/delete/85559/in+docs Del: other reasons-- https://master.php.net/note/delete/85559 Reject -- https://master.php.net/note/reject/85559 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144174) next »