ID: 38235 User updated by: tony at marston-home dot demon dot co dot uk Reported By: tony at marston-home dot demon dot co dot uk Status: Open Bug Type: Unknown/Other Function Operating System: Windows XP PHP Version: 5CVS-2006-07-27 (CVS) New Comment:
I've also tried replacing it with the one I use on my other PC which runs PHP 4, but I get the same error. Previous Comments: ------------------------------------------------------------------------ [2006-07-27 16:03:01] tony at marston-home dot demon dot co dot uk It is the one included in the zip file which I downloaded from the PHP website. ------------------------------------------------------------------------ [2006-07-27 12:40:09] [EMAIL PROTECTED] 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? ------------------------------------------------------------------------ [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