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

webservant316’s picture

Hmm just looks like an expansion of the system requirements in the new module. My installation must be failing on line 170 of webfm.module...

if (!extension_loaded('fileinfo') OR !function_exists('mime_content_type')) {

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.

webservant316’s picture

Priority: Normal » Major

hmm, sadly just noticed users cannot view my webfm files. perhaps this feature must work. any help?

webservant316’s picture

OK 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

webservant316’s picture

Title: "File Information Extension" disabled on admin/reports/status after upgrade to 2.18 » How do I install the extension 'fileinfo' in PHP 5.2.17 for the 'mime_content_type' function, now required by Webfm 2.18

Changing title to reflect true issue support need

webservant316’s picture

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

webservant316’s picture

Status: Active » Fixed

continuing discussion over here
http://drupal.org/node/1361200

nhck’s picture

Category: support » bug
Priority: Major » Minor

webservant316, 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.

webservant316’s picture

thanks. got it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.