The finfo method and functions are missing from XAMPP 1.7.2!

Problems with the Windows version of XAMPP, questions, comments, and anything related.

The finfo method and functions are missing from XAMPP 1.7.2!

Postby lamando » 05. December 2009 06:36

Hello!

I've been trying to use the finfo method and the finfo_ functions. They are described to be included by default in PHP 5.3.0+ (see http://www.php.net/manual/en/fileinfo.installation.php ):

This extension is enabled by default as of PHP 5.3.0. Before this time, fileinfo was a PECL extension but is no longer maintained there.


But it seems that they are missing from the latest stable XAMPP (1.7.2):

Fatal error: Class 'finfo' not found [...]


It doesn't seem to be a PHP issue since it is not listed in the fixed bugs in PHP 5.3.1

Can someone confirm that it is a XAMPP issue? Do you encounter the same problem? Here's a quick code to test:

Code: Select all

<php
if 
( function_exists( 'finfo_open' ) ) {
    echo "OMG IT WORKS!!";
}
 else {
    echo "Bad news... :(";
}
?>


Thanks a lot everyone for the hard work, XAMPP is great ;)
lamando
 
Posts: 7
Joined: 11. November 2009 12:43

Re: The finfo method and functions are missing from XAMPP 1.7.2!

Postby Izzy » 05. December 2009 06:46

Try editing the \xampp\php\php.ini file and uncomment this line, remove the ; from in front of the extension name
Code: Select all
;extension=php_fileinfo.dll
Save the file and restart Apache and test again.
Last edited by Izzy on 05. December 2009 06:50, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: The finfo method and functions are missing from XAMPP 1.7.2!

Postby lamando » 05. December 2009 06:47

Update: I've tried to uncomment the line
Code: Select all
extension=php_fileinfo.dll

in php.ini

Resulted in many errors at Apache start and a crash of the apache process after few seconds. I had to comment back the line to be able to start Apache...

:?
lamando
 
Posts: 7
Joined: 11. November 2009 12:43

Re: The finfo method and functions are missing from XAMPP 1.7.2!

Postby lamando » 05. December 2009 06:52

Izzy wrote:Try editing the \xampp\php\php.ini file and uncomment this line, remove the ; from in front of the extension name
Code: Select all
;extension=php_fileinfo.dll
Save the file and restart Apache and test again.

Lol burned, had the same idea as you :mrgreen:

I think some file are missing, see:

Image

Image

Apache crashes immediately after I click OK...
lamando
 
Posts: 7
Joined: 11. November 2009 12:43

Re: The finfo method and functions are missing from XAMPP 1.7.2!

Postby Izzy » 05. December 2009 07:00

Anything in the \xampp\apache\logs\error.log file?
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: The finfo method and functions are missing from XAMPP 1.7.2!

Postby lamando » 05. December 2009 07:10

PHP Warning: Function registration failed - duplicate name - mime_content_type in Unknown on line 0
PHP Warning: mime_magic: Unable to register functions, unable to load in Unknown on line 0
[Sat Dec 05 00:48:51 2009] [warn] pid file [...]xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sat Dec 05 00:48:51 2009] [notice] Digest: generating secret for digest authentication ...
[Sat Dec 05 00:48:51 2009] [notice] Digest: done
PHP Warning: Function registration failed - duplicate name - mime_content_type in Unknown on line 0
PHP Warning: mime_magic: Unable to register functions, unable to load in Unknown on line 0
lamando
 
Posts: 7
Joined: 11. November 2009 12:43

Re: The finfo method and functions are missing from XAMPP 1.7.2!

Postby Wiedmann » 05. December 2009 12:11

lamando wrote:Update: I've tried to uncomment the line
Code: Select all
extension=php_fileinfo.dll

Resulted in many errors at Apache start and a crash of the apache process after few seconds.

Additionally you must disable the "php_mime_magic.dll" extension.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: The finfo method and functions are missing from XAMPP 1.7.2!

Postby lamando » 05. December 2009 22:15

Wiedmann wrote:
lamando wrote:Update: I've tried to uncomment the line
Code: Select all
extension=php_fileinfo.dll

Resulted in many errors at Apache start and a crash of the apache process after few seconds.

Additionally you must disable the "php_mime_magic.dll" extension.


Thanks for your help. I've disabled the mime_magic extension, now Apache is able to start and there's no error.

However, it still doesn't work, there's no error but it looks like the magic database file is empty :?

For example, the code bellow will always output "text/x-c; charset=us-ascii" for any text files

Code: Select all

<?php

$finfo 
= new finfo(FILEINFO_MIME);
echo $finfo->file('test.js');

?>


:(
lamando
 
Posts: 7
Joined: 11. November 2009 12:43


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 59 guests