Bug 163116

Summary: mime_content_type fails because of wrong mime_magic.magicfile
Product: [Fedora] Fedora Reporter: Anders Kaseorg <andersk>
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: ian
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: 5.0.4-10.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-08 10:22:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Anders Kaseorg 2005-07-13 00:22:10 UTC
Description of problem:
PHP is built with the '--with-mime-magic=/usr/share/file/magic.mime' configure
option, causing the mime_content_type() function to fail: it always returns
'text/plain'. phpinfo() reports "mime_magic support: invalid magic file,
disabled." From <http://www.php.net/manual/en/ref.mime-magic.php>:

"The extension needs a copy of the simplified magic file that is distributed
with the Apache httpd. [...] Note: This extension is not capable of handling the
fully decorated magic file that generally comes with standard Linux distro's and
is supposed to be used with recent versions of file command."

Indeed, the function works after setting mime_magic.magicfile =
"/etc/httpd/conf/magic" in php.ini.

PHP should therefore be configured '--with-mime-magic=/etc/httpd/conf/magic'.

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

How reproducible:

Steps to Reproduce:
1. Open a .php file containing <?php phpinfo(); ?>.

Actual results:
mime_magic support: invalid magic file, disabled
mime_magic.magicfile: /usr/share/file/magic.mime

Expected results:
mime_magic support: enabled
mime_magic.magicfile: /etc/httpd/conf/magic

Comment 1 Ian Neubert 2005-07-14 18:07:48 UTC
Same problem with php-5.0.4-10.3.

Comment 2 Ian Neubert 2005-07-14 18:09:12 UTC
I guess that was the OP's version too. I should have read it a bit more carefully.

Comment 3 Joe Orton 2005-08-04 12:38:38 UTC
Thanks for the report, this will be fixed in a future update.

Comment 4 Joe Orton 2005-09-08 10:22:26 UTC
This was fixed in the 5.0.4-10.4 update - thanks for the report.