Access Apache Mime-Type attribute for extension

Does PHP provide an instance of Apache Mime-Type to display extensions in any way or form.

Thus, Apache usually has a list of file extensions (.gif, .pdf) that it maps to the Mime-Types list (image / gif, application / pdf, etc.) in a file, usually called mime. types. Is there a way to get a list of these mappings for the current apache process via PHP?

Lacking this, is there any way for PHP to ask Apache which mime.type file it uses?

+5
source share
1 answer

You are probably using php as CGI, but if you are using mod_php and the file is accessible via the url, you can see:

http://us2.php.net/manual/en/function.apache-lookup-uri.php

, openbasedir, file('/usr/local/apache2/conf/mime.types')

+2

All Articles