From:             tony at marston-home dot demon dot co dot uk
Operating system: Windows XP
PHP version:      5CVS-2006-07-27 (CVS)
PHP Bug Type:     Unknown/Other Function
Bug description:  mime_content_type does not return content type

Description:
------------
When I use mime_content_type("picture.jpg") it always returns FALSE
instead of "image/jpeg". At runtime I see the error "mime_content_type():
mime_magic not initialized".

I have the following in my php.ini file:

[mime_magic]
mime_magic.magicfile = "F:/PHP5/extras/magic.mime"
mime_magic.debug = On

This information shows up correctly with phpinfo().

I also notice in the phperror.log a lot of messages along the lines of:

[27-Jul-2006 11:37:13] PHP Warning:  PHP Startup: :
(F:/PHP5/extras/magic.mime:274) 'L      application/x-bootable' is not a valid
mimetype, entry skipped in Unknown on line 0

Reproduce code:
---------------
$content_type = mime_content_type("picture.jpg");
if (empty($content_type)) {
   echo "content_type is empty";
}

Expected result:
----------------
I expect it to return "image/jpeg" for this file.

Actual result:
--------------
It always returns FALSE.

-- 
Edit bug report at http://bugs.php.net/?id=38235&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38235&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38235&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38235&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38235&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38235&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38235&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38235&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38235&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38235&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38235&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38235&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38235&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38235&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38235&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38235&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38235&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38235&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38235&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38235&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38235&r=mysqlcfg

Reply via email to