Upgraded to 2.18. Now admin/reports/status shows...
===
File Information Extension Disabled
In order to check whether the uploaded file acutally is of the type its file extension suggests. Web File Manager uses the php fileinfo extension in order to do that.
===
Why did that happen? How do I enabled it again? I am using PHP 5.2.11. Perhaps the new release uses a PHP function not supported by my install?
Comments
Comment #1
webservant316 commentedHmm just looks like an expansion of the system requirements in the new module. My installation must be failing on line 170 of webfm.module...
Perhaps my server doesn't have those functions.
I presume that in my case the module will still function as it had, but without the extra security feature.
Comment #2
webservant316 commentedhmm, sadly just noticed users cannot view my webfm files. perhaps this feature must work. any help?
Comment #3
webservant316 commentedOK I see that I need to install the 'fileinfo' PHP extension. I did that BUT the mime_content_type() function is still undefined. Anyone have experience with this? My webfm file downloads are broken until I fix this.
===
My server is CentOS Linux
$uname -a
Linux hostname 2.6.18-028stab070.14 #1 SMP Thu Nov 18 16:04:02 MSK 010 i686 i386 GNU Linux
===
Running PHP 5.2.17
===
I downloaded and installed PECL / Fileinfo 1.0.4 from here http://pecl.php.net/package/Fileinfo
===
The extension is installed, see...
$php -r "phpinfo();" | grep "fileinfo"
fileinfo
fileinfo support -> enabled
===
This line was also added to my php.ini
extension=fileinfo.so
===
extension_loaded('fileinfo') also return TRUE
===
So I did all that and function_exists('mime_content_type') still returns FALSE.
How can that be?
===
So I read this post http://www.php.net/manual/en/ref.fileinfo.php#72264 and added this line to php.ini
mime_magic.magicfile=/usr/share/file/magic
===
But function_exists('mime_content_type') still returns FALSE.
===
Anyone with any ideas? If I cannot get the extension to work perhaps I can create a hack for mime_content_type(). I saw one here http://www.php.net/manual/en/function.mime-content-type.php#84149.
Thanks for any help,
Jeff
Comment #4
webservant316 commentedChanging title to reflect true issue support need
Comment #5
webservant316 commentedhey wait a minute. looks like the function mime_content_type() is a deprecated PHP function that is not part of the fileinfo library.
Seems to me like line 168 of webfm.module should be revised
- if (!extension_loaded('fileinfo') OR !function_exists('mime_content_type')) {
+ if (!extension_loaded('fileinfo') AND !function_exists('mime_content_type')) {
In conclusion after looking at the webfm code it seems like webfm should still function and allow file downloads even with the warning. However, all my webfm file downloads result in an access denied. This must be another issue so I am turning to investigate the issues queue.
Comment #6
webservant316 commentedcontinuing discussion over here
http://drupal.org/node/1361200
Comment #7
nhck commentedwebservant316, thank you for reporting this and helping to make webfm better. That was indeed a mistake in hook_requirements. I've changed it so it refelects the true state now. As for your comment: We just issue a warning - so you don't need to take any action if you do not want to (thus 'severity' => REQUIREMENT_WARNING).
Thank you.
Comment #8
webservant316 commentedthanks. got it.