|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-07-27 12:40 UTC] iliaa@php.net
  [2006-07-27 16:03 UTC] tony at marston-home dot demon dot co dot uk
  [2006-07-27 16:04 UTC] tony at marston-home dot demon dot co dot uk
  [2006-12-21 17:48 UTC] sonne at gaskanalen dot dk
  [2007-07-17 10:08 UTC] jani@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 16:00:01 2025 UTC | 
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.