Installation Check fails for Fileinfo PHP Extension

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
sachintha81
Posts: 20
Joined: 07 Mar 2019, 20:59

Installation Check fails for Fileinfo PHP Extension

Post by sachintha81 »

I'm doing a new installation of MantisBT. Here is the configuration of my system.

Code: Select all

OS: Windows Server 2012 R2 (Version 6.2, Build 9200)
IIS Version: 8.5.9600.16384
PHP Version: 7.2.7 (verified that it's working)
Mantis Version: MantisBT 2.19.0
Browser: Google Chrome Version 72.0.3626.121 (Official Build) (64-bit)
I successfully completed the installation, and proceeded to verify it as instructed in the Admin Guide by running admin/check/index.php
All tests except for one succeeds, and the following fails:

Image

I Googled this and as instructed in the following bug reports, made sure that extension=php_fileinfo.dll in php.ini is set correctly.
https://mantisbt.org/bugs/view.php?id=24501
https://mantisbt.org/bugs/view.php?id=24257

Then I restarted IIS as well as the System, but I still get the error. What am I missing and how do I fix it?
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Installation Check fails for Fileinfo PHP Extension

Post by cas »

Create a small script called test.php on your webserver (can be in the root) with the following content:

Code: Select all

<?php
phpinfo();
Now run the script in your browser and it will show you all info you need to tackle this.
First check if you adjusted the correct php.ini.
sachintha81
Posts: 20
Joined: 07 Mar 2019, 20:59

Re: Installation Check fails for Fileinfo PHP Extension

Post by sachintha81 »

Thanks for the reply!

I did as you instructed and got a bunch of information. However I'm not a web/php person and not quite sure what to look for there or how to proceed. Any pointers on where to look and how to proceed would be great!
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Installation Check fails for Fileinfo PHP Extension

Post by cas »

it tells you which php.ini has been used. Check that file if the extenstion is active.
sachintha81
Posts: 20
Joined: 07 Mar 2019, 20:59

Re: Installation Check fails for Fileinfo PHP Extension

Post by sachintha81 »

That did the trick!

I had changed the x86 php.ini when my mantis was using x64. Thanks a bunch!
sachintha81
Posts: 20
Joined: 07 Mar 2019, 20:59

Re: Installation Check fails for Fileinfo PHP Extension

Post by sachintha81 »

cas wrote: 11 Mar 2019, 18:37 it tells you which php.ini has been used. Check that file if the extenstion is active.
OK, I'm running into the same problem again now. It was working briefly, and now back to not working.

When I click 'Add Note' after attaching a file, the progression starts but halfway through, it goes to an error page:
INTERNAL APPLICATION ERROR

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Installation Check fails for Fileinfo PHP Extension

Post by atrol »

Did you run again admin/check/index.php after Fileinfo extension has been enabled?
Please use Search before posting and read the Manual
sachintha81
Posts: 20
Joined: 07 Mar 2019, 20:59

Re: Installation Check fails for Fileinfo PHP Extension

Post by sachintha81 »

Yes, and at the time it verified that php was working fine. It did give a bunch of other errors/warnings such as email related which I fixed one by one.

It actually started working and attachments were successful. After that I installed the BBCodePlus plugin, and while working on that, later, I realized attachments went back to not working.

EDIT
I did a second run of admin/check/index.php, and this time it doesn't proceed past the PHP tests. It's basically frozen at the following status:

Image
Last edited by sachintha81 on 13 Mar 2019, 18:18, edited 2 times in total.
sachintha81
Posts: 20
Joined: 07 Mar 2019, 20:59

Re: Installation Check fails for Fileinfo PHP Extension

Post by sachintha81 »

I'm attaching the PHP72x64_errors.log here, right after attempting two (.txt and a .png) file uploads. Both times I get the same error message:

TXT Upload:
[13-Mar-2019 10:33:48 America/Los_Angeles] finfo::finfo(): Failed to load magic database at '(null)'.
C:\Websites\LAT\mantis\core\file_api.php: 1004: finfo - -> - finfo( <integer>1040 )
C:\Websites\LAT\mantis\core\file_api.php: 1023: - - - - file_create_finfo()
C:\Websites\LAT\mantis\core\file_api.php: 710: - - - - file_get_mime_type( <string>'C:\\Windows\\Temp\\php376B.tmp' )
C:\Websites\LAT\mantis\core\file_api.php: 73: - - - - file_add( <integer>1, <array> { ['name'] => 'Att.txt', ['type'] => 'text/plain', ['tmp_name'] => 'C:\\Windows\\Temp\\php376B.tmp', ['error'] => 0, ['size'] => 3, ['browser_upload'] => true }, <string>'bug' )
C:\Websites\LAT\mantis\core\commands\IssueFileAddCommand.php: 154: - - - - file_attach_files( <integer>1, <array> { [0] => <array> { ['name'] => 'Att.txt', ['type'] => 'text/plain', ['tmp_name'] => 'C:\\Windows\\Temp\\php376B.tmp', ['error'] => 0, ['size'] => 3 } } )
C:\Websites\LAT\mantis\core\commands\Command.php: 137: IssueFileAddCommand - -> - process()
C:\Websites\LAT\mantis\bugnote_add.php: 58: Command - -> - execute()

PNG Upload:
[13-Mar-2019 10:34:48 America/Los_Angeles] finfo::finfo(): Failed to load magic database at '(null)'.
C:\Websites\LAT\mantis\core\file_api.php: 1004: finfo - -> - finfo( <integer>1040 )
C:\Websites\LAT\mantis\core\file_api.php: 1023: - - - - file_create_finfo()
C:\Websites\LAT\mantis\core\file_api.php: 710: - - - - file_get_mime_type( <string>'C:\\Windows\\Temp\\php21CC.tmp' )
C:\Websites\LAT\mantis\core\file_api.php: 73: - - - - file_add( <integer>1, <array> { ['name'] => 'Capture.PNG', ['type'] => 'image/png', ['tmp_name'] => 'C:\\Windows\\Temp\\php21CC.tmp', ['error'] => 0, ['size'] => 3812, ['browser_upload'] => true }, <string>'bug' )
C:\Websites\LAT\mantis\core\commands\IssueFileAddCommand.php: 154: - - - - file_attach_files( <integer>1, <array> { [0] => <array> { ['name'] => 'Capture.PNG', ['type'] => 'image/png', ['tmp_name'] => 'C:\\Windows\\Temp\\php21CC.tmp', ['error'] => 0, ['size'] => 3812 } } )
C:\Websites\LAT\mantis\core\commands\Command.php: 137: IssueFileAddCommand - -> - process()
C:\Websites\LAT\mantis\bugnote_add.php: 58: Command - -> - execute()

My config file
# --- Attachments / File Uploads ---
$g_allow_file_upload = ON;
$g_dropzone_enabled = ON;
$g_file_upload_method = DATABASE; # or DISK
$g_absolute_path_default_upload_folder = 'C:/Windows/Temp/'; # used with DISK, must contain trailing \ or /.
$g_max_file_size = 5000000; # in bytes
$g_preview_attachments_inline_max_size = 256 * 1024;
$g_allowed_files = 'TXT,txt,jpg,jpeg,png,bmp,log,as,html'; # extensions comma separated, e.g. 'php,html,java,exe,pl'
$g_disallowed_files = 'exe'; # extensions comma separated

EDIT
Forgot attachments.
Attachments
PHP72x64_errors.log
(98.41 KiB) Downloaded 420 times
Post Reply