Bug 130276 - PHP's mime_content_type() isn't available, compile with --with-mime-magic
Summary: PHP's mime_content_type() isn't available, compile with --with-mime-magic
Alias: None
Product: Fedora
Classification: Fedora
Component: php
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL: http://www.php.net/mime_content_type
: 112859 (view as bug list)
Depends On:
Blocks: FC3Target
TreeView+ depends on / blocked
Reported: 2004-08-18 17:58 UTC by Robert Scheck
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version: 4.3.8-5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2004-08-19 14:00:02 UTC

Attachments (Terms of Use)

Description Robert Scheck 2004-08-18 17:58:29 UTC
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 

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

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

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 22:32:09 UTC
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 13:08:22 UTC
Needs a "Requires: file" file too, presumably.  Just checking how big
this extension is before enabling.

Comment 3 Robert Scheck 2004-08-19 13:18:20 UTC
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 13:45:19 UTC
*** Bug 112859 has been marked as a duplicate of this bug. ***

Comment 5 Joe Orton 2004-08-19 14:00:02 UTC
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.