Bug 130276

Summary: PHP's mime_content_type() isn't available, compile with --with-mime-magic
Product: [Fedora] Fedora Reporter: Robert Scheck <redhat-bugzilla>
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: roel
Target Milestone: ---Keywords: EasyFix
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://www.php.net/mime_content_type
Whiteboard:
Fixed In Version: 4.3.8-5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-19 14:00:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 123268    

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 
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 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.