ID: 38235 Updated by: [EMAIL PROTECTED] Reported By: tony at marston-home dot demon dot co dot uk -Status: Open +Status: Feedback Bug Type: Unknown/Other Function Operating System: Windows XP PHP Version: 5CVS-2006-07-27 (CVS) New Comment:
it sounds to me like you mime magic file is invalid and subsequently results in an empty mime database in PHP. This would explain why the function always returns false. Where did you get the mime magic file that you are using? Previous Comments: ------------------------------------------------------------------------ [2006-07-27 10:52:37] tony at marston-home dot demon dot co dot uk 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 this bug report at http://bugs.php.net/?id=38235&edit=1