Bug 130276 - PHP's mime_content_type() isn't available, compile with --with-mime-magic
PHP's mime_content_type() isn't available, compile with --with-mime-magic
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: php (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
David Lawrence
http://www.php.net/mime_content_type
: EasyFix
: 112859 (view as bug list)
Depends On:
Blocks: FC3Target
  Show dependency treegraph
 
Reported: 2004-08-18 13:58 EDT by Robert Scheck
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version: 4.3.8-5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-19 10:00:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Robert Scheck 2004-08-18 13:58:29 EDT
Description of problem:
I can't use the PHP function mime_content_type(), because PHP is 
compiled without "--with-mime-magic", that refers to the following 
error:

"Fatal error: Call to undefined function: mime_content_type() in ..."

Version-Release number of selected component (if applicable):
php-4.3.8-4

How reproducible / Steps to Reproduce:
Everytime, see above.

Actual results:
Compiling PHP with the configure parameter '--with-mime-magic' would
solve this problem.

We also should set 

  mime_magic.magicfile = "/usr/share/file/magic.mime"

in the /etc/php.ini then, because Red Hat doesn't deliver the default
expected magic.mime in /usr/share/misc/.

Expected results:
PHP with '--with-mime-magic'.
Comment 1 Robert Scheck 2004-08-18 18:32:09 EDT
Oh, I saw, that it is even more easily (so threw my other text 
above away):

--- snipp ---
--- php.spec       2004-08-19 00:26:27.000000000 +0200
+++ php.spec.rsc   2004-08-19 00:28:54.000000000 +0200
@@ -408,6 +408,7 @@
         --enable-dio \
         --enable-mbstring=shared --enable-mbstr-enc-trans \
         --enable-mbregex \
+        --with-mime-magic=%{_datadir}/file/magic.mime
        $* || tail -300 config.log

 make %{?_smp_mflags}
--- snapp ---

And this bug is a Red Hat related bug, because magic.mime is not 
delivered to the default places where it should be. Normally mime-
magic support is enabled per default. I also didn't pass 
'%{_datadir}/magic.mime' because it's only a symbolic link, that 
maybe will go away...
Comment 2 Joe Orton 2004-08-19 09:08:22 EDT
Needs a "Requires: file" file too, presumably.  Just checking how big
this extension is before enabling.
Comment 3 Robert Scheck 2004-08-19 09:18:20 EDT
Compared without the "Requires: file" (hehe, a few bytes more), I've 
got the following result here (complete size of all (src) rpms):

9,608 MB with mime magic
9,592 MB without mime magic

also ~ 16 KB more at my build system. I think the size shouldn't be 
the problem for this (normally default) extension.
Comment 4 Joe Orton 2004-08-19 09:45:19 EDT
*** Bug 112859 has been marked as a duplicate of this bug. ***
Comment 5 Joe Orton 2004-08-19 10:00:02 EDT
Works for me then.  Added in 4.3.8-5; thanks for the report.

Note You need to log in before you can comment on or make changes to this bug.