note 85244 added to function.mime-content-type
| From: | php | Date: | Thu, 21 Aug 2008 17:52:22 +0000 |
| Subject: | note 85244 added to function.mime-content-type | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143720@lists.php.net to get a copy of this message | ||
I also had issues with this function.
The issue was that it would almost always return "text/plain".
echo ini_get('mime_magic.magicfile'); // returns /etc/httpd/conf/magic
I found that I needed the OS' magic.mime file instead.
You can either copy it to the existing location, or update your php.ini, you cannot use ini_set().
[root@blade conf]# mv magic magic.old
[root@blade conf]# cp /usr/share/magic.mime magic
[root@blade conf]# apachectl graceful
Note: you will see that I have gracefully restarted apache to ensure it has taken affect.
----
Server IP: 92.48.100.16
Probable Submitter: 82.152.138.226
----
Manual Page -- http://www.php.net/manual/en/function.mime-content-type.php
Edit -- https://master.php.net/note/edit/85244
Del: integrated -- https://master.php.net/note/delete/85244/integrated
Del: useless -- https://master.php.net/note/delete/85244/useless
Del: bad code -- https://master.php.net/note/delete/85244/bad+code
Del: spam -- https://master.php.net/note/delete/85244/spam
Del: non-english -- https://master.php.net/note/delete/85244/non-english
Del: in docs -- https://master.php.net/note/delete/85244/in+docs
Del: other reasons-- https://master.php.net/note/delete/85244
Reject -- https://master.php.net/note/reject/85244
Search -- https://master.php.net/manage/user-notes.php