ID:               26918
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jalonso at art3mis dot com
-Status:           Open
+Status:           Bogus
-Bug Type:         Unknown/Other Function
+Bug Type:         *General Issues
 Operating System: debian / linux
 PHP Version:      5.0.0b3 (beta3)
 New Comment:

You can't set these options in scripts. Only in php.ini.
And you can only use the magic file that comes with Apache..

>From manual (http://www.php.net/manual/en/ref.mime-magic.php):

"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."

The mime_magic.debug option, when set to On, only outputs errors during
startup. So you need to set 'display_startup_errors = On' too in
php.ini if you turn it on. Just DO NOT use this option, it's meant for
DEBUGGING.

See also phpinfo() output for this extension..it will say 
"mime_magic support => invalid magic file, disabled" when you're trying
to use invalid file with it.





Previous Comments:
------------------------------------------------------------------------

[2004-01-15 06:37:32] jalonso at art3mis dot com

Description:
------------
mime_content_type() will return text/plain for all files except if you
set mime_magic.debug to On on php.ini. It won't work if you try to
change it with ini_alter('mime_magic.debug').

Reproduce code:
---------------
php.ini has 
mime_magic.magicfile = "/usr/share/misc/file/magic.mime"
;mime_magic.debug     = On


<?php
echo mime_content_type('/bin/ping');
?>

Expected result:
----------------
application/x-executable

Actual result:
--------------
text/plain


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26918&edit=1

Reply via email to