# PHP Fileinfo functions not working

**URL:** <https://forums.suse.com/t/php-fileinfo-functions-not-working/21671>\
**Category:** SLED Configure-Administer\
**Created:** [October 31, 2011, 11:36pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671 "2011-10-31T23:36:02Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![System1](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@System1](https://forums.suse.com/u/System1)\
**Post date:** [October 31, 2011, 11:36pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/1 "2011-10-31T23:36:02Z")

</div>

I’ve installed fileinfo PECL extension but I still receive this error:[color=blue]

> Fatal error: Call to undefined function finfo\_open() in  
> /home/alex/public\_html/mime.php on line 3[/color]  
> The strange thing is it’s not working if PHP’s used as an apache  
> module, but if I run[color=blue]  
> php -r “phpinfo();” | grep “fileinfo”[/color]  
> in terminal I receive[color=blue]  
> /etc/php5/conf.d/fileinfo.ini,  
> fileinfo  
> fileinfo support =\> enabled[/color]  
> SLED-11 SP1, php-5.2.14, apache-2.2.10  
> Is there a workaround to make it work?

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 1, 2011, 12:16am UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/2 "2011-11-01T00:16:01Z")

</div>

And also in cli[color=blue]

> php -r “print\_r(get\_defined\_functions());” | grep “finfo”  
> [727] =\> finfo\_open  
> [728] =\> finfo\_close  
> [729] =\> finfo\_set\_flags  
> [730] =\> finfo\_file  
> [731] =\> finfo\_buffer[/color]  
> But it doesn’t work with apache.

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 1, 2011, 12:30am UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/3 "2011-11-01T00:30:37Z")

</div>

On Mon, 31 Oct 2011 21:36:02 GMT  
AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
[color=blue]

> I’ve installed fileinfo PECL extension but I still receive this error:[color=green]
> 
> > Fatal error: Call to undefined function finfo\_open() in  
> > /home/alex/public\_html/mime.php on line 3[/color]  
> > The strange thing is it’s not working if PHP’s used as an apache  
> > module, but if I run[color=green]  
> > php -r “phpinfo();” | grep “fileinfo”[/color]  
> > in terminal I receive[color=green]  
> > /etc/php5/conf.d/fileinfo.ini,  
> > fileinfo  
> > fileinfo support =\> enabled[/color]  
> > SLED-11 SP1, php-5.2.14, apache-2.2.10  
> > Is there a workaround to make it work?
> 
> [/color]  
> Hi  
> php5-fileinfo from where, it’s not in the normal repositories?

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 11.4 (x86\_64) Kernel 2.6.37.6-0.7-desktop  
up 9:35, 3 users, load average: 0.01, 0.07, 0.11  
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 1, 2011, 12:56am UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/4 "2011-11-01T00:56:02Z")

</div>

I’ve rebuilt an OpenSUSE src package.

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 1, 2011, 1:02am UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/5 "2011-11-01T01:02:28Z")

</div>

On Mon, 31 Oct 2011 22:56:02 GMT  
AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
[color=blue]

> I’ve rebuilt an OpenSUSE src package.
> 
> [/color]  
> Hi  
> I would look at trying the second one in the list…  
> [http://software.opensuse.org/search?q=php5-fileinfo&baseproject=SUSE%3ASLE-11%3ASP1&lang=en&exclude\_debug=true](http://software.opensuse.org/search?q=php5-fileinfo&baseproject=SUSE%3ASLE-11%3ASP1&lang=en&exclude_debug=true)

I’m assuming the first one in the above list must match your php  
version.

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 11.4 (x86\_64) Kernel 2.6.37.6-0.7-desktop  
up 10:05, 3 users, load average: 0.31, 0.24, 0.17  
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 1, 2011, 9:56am UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/6 "2011-11-01T09:56:02Z")

</div>

malcolmlewis;2150357 Wrote:[color=blue]

> On Mon, 31 Oct 2011 22:56:02 GMT  
> AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
> [color=green]
> 
> > I’ve rebuilt an OpenSUSE src package.
> > 
> > [/color]  
> > Hi  
> > I would look at trying the second one in the list…  
> > ‘[software.opensuse.org](http://software.opensuse.org): Search Results’  
> > ([http://software.opensuse.org/search?q=php5-fileinfo&baseproject=SUSE%3ASLE-11%3ASP1&lang=en&exclude\_debug=true](http://software.opensuse.org/search?q=php5-fileinfo&baseproject=SUSE%3ASLE-11%3ASP1&lang=en&exclude_debug=true))
> 
> I’m assuming the first one in the above list must match your php  
> version.
> 
> –  
> Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
> openSUSE 11.4 (x86\_64) Kernel 2.6.37.6-0.7-desktop  
> up 10:05, 3 users, load average: 0.31, 0.24, 0.17  
> GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09[/color]

It suggests to change php version to the OpenSUSE latest 5.3.8 with  
vendor change, though I have 5.2.14.

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 2, 2011, 5:34pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/7 "2011-11-02T17:34:23Z")

</div>

On Tue, 01 Nov 2011 07:56:02 GMT  
AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
[color=blue]

> malcolmlewis;2150357 Wrote:[color=green]
> 
> > On Mon, 31 Oct 2011 22:56:02 GMT  
> > AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
> > [color=darkred]
> > 
> > > I’ve rebuilt an OpenSUSE src package.
> > > 
> > > [/color]  
> > > Hi  
> > > I would look at trying the second one in the list…  
> > > ‘[software.opensuse.org](http://software.opensuse.org): Search Results’  
> > > ([http://software.opensuse.org/search?q=php5-fileinfo&baseproject=SUSE%3ASLE-11%3ASP1&lang=en&exclude\_debug=true](http://software.opensuse.org/search?q=php5-fileinfo&baseproject=SUSE%3ASLE-11%3ASP1&lang=en&exclude_debug=true))
> > 
> > I’m assuming the first one in the above list must match your php  
> > version.  
> > [/color]  
> > It suggests to change php version to the OpenSUSE latest 5.3.8 with  
> > vendor change, though I have 5.2.14.
> 
> [/color]  
> Hi  
> So what happens if you grab the php5 src rpm for the installed version  
> and rebuild that rpm, it should produce the php5-fileinfo rpm.

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 11.4 (x86\_64) Kernel 2.6.37.6-0.7-desktop  
up 2 days 2:35, 5 users, load average: 0.01, 0.02, 0.05  
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 2, 2011, 10:46pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/8 "2011-11-02T22:46:02Z")

</div>

I simply can’t download it. When I try it asks for authorization and my  
usual Novell account data doesn’t work. So I’m not permitted to do  
that.  
May be it’s just a Novell problem? It happens that sometimes I can’t  
post here (though I’m logged in it still requires authorization).

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 2, 2011, 11:04pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/9 "2011-11-02T23:04:17Z")

</div>

On Wed, 02 Nov 2011 20:46:02 GMT  
AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
[color=blue]

> I simply can’t download it. When I try it asks for authorization and  
> my usual Novell account data doesn’t work. So I’m not permitted to do  
> that.  
> May be it’s just a Novell problem? It happens that sometimes I can’t  
> post here (though I’m logged in it still requires authorization).
> 
> [/color]  
> Hi  
> Clear all the Novell cookies from your browser cache.

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 11.4 (x86\_64) Kernel 2.6.37.6-0.7-desktop  
up 2 days 8:08, 5 users, load average: 0.12, 0.13, 0.13  
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 3, 2011, 7:46am UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/10 "2011-11-03T07:46:02Z")

</div>

I did but authorization is still required. And my Novell account data  
isn’t valid to download the package. It’s strange, but at the moment I  
can’t download anything from Novell.

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 3, 2011, 8:06am UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/11 "2011-11-03T08:06:02Z")

</div>

I’ve cleared cookies and generated new credentials according to this’  
note ’ ([http://support.novell.com/linux/sources.html#code10note](http://support.novell.com/linux/sources.html#code10note)) but  
anyway I receive:[color=blue]

> 403 Forbidden
> 
> Access to this page is restricted because of access control policies.[/color]

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 3, 2011, 3:14pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/12 "2011-11-03T15:14:55Z")

</div>

On Thu, 03 Nov 2011 06:06:02 GMT  
AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
[color=blue]

> I’ve cleared cookies and generated new credentials according to this’  
> note ’ ([http://support.novell.com/linux/sources.html#code10note](http://support.novell.com/linux/sources.html#code10note)) but  
> anyway I receive:[color=green]
> 
> > 403 Forbidden
> > 
> > Access to this page is restricted because of access control  
> > policies.[/color]
> 
> [/color]  
> Hi  
> Weird, normally cleaning them out works. Did you try an alternative  
> browser, or perhaps different machine?

Can you provide the download link your trying to use.

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 11.4 (x86\_64) Kernel 2.6.37.6-0.7-desktop  
up 3 days 0:18, 5 users, load average: 0.11, 0.25, 0.23  
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 3, 2011, 5:46pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/13 "2011-11-03T17:46:01Z")

</div>

Here is the link  
[https://nu.novell.com/repo/$RCE/SLE11-SP1-SDK-Updates/sle-11-i586/rpm/src/](https://nu.novell.com/repo/$RCE/SLE11-SP1-SDK-Updates/sle-11-i586/rpm/src/)  
Yes, I tried other browser and computer. Yes, I was able to log in to  
SLED updates page but not to the SDK updates.

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 3, 2011, 6:57pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/14 "2011-11-03T18:57:49Z")

</div>

On Thu, 03 Nov 2011 15:46:01 GMT  
AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
[color=blue]

> Here is the link  
> [https://nu.novell.com/repo/$RCE/SLE11-SP1-SDK-Updates/sle-11-i586/rpm/src/](https://nu.novell.com/repo/$RCE/SLE11-SP1-SDK-Updates/sle-11-i586/rpm/src/)  
> Yes, I tried other browser and computer. Yes, I was able to log in to  
> SLED updates page but not to the SDK updates.
> 
> [/color]  
> Hi  
> That link requires your mirror credentials to login.

Had a look at the source and I have the feeling that fileinfo is not  
available for that release, can’t see it in the configure output.

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 11.4 (x86\_64) Kernel 2.6.37.6-0.7-desktop  
up 3 days 4:01, 6 users, load average: 0.93, 0.93, 0.94  
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 3, 2011, 10:36pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/15 "2011-11-03T22:36:02Z")

</div>

Hi, Malcolm!  
I gave up trying to configure Novell’s PHP and compiled my own instance  
of Apache+PHP. Of course everything is included.  
Fortunately I had enough time in late September to wipe away SLED from  
my notebooks and install another much more stable and reliable OS on  
them. I’ve left only one installation on my personal laptop just for  
testing (of course not the primary installation), but after installing  
several drivers, PHP and many other things from sources, Document  
Foundation’s LibreOffice only because Novell’s versions are crap there’s  
not much left of SLED.  
I had to change my hosting provider as well because they use SLES on  
their server (that’s why I wanted to keep and configure my SLED - to be  
able to test scripts in the native environment) and fileinfo and some  
other functions are not available there.

## – AlexDudko

AlexDudko’s Profile: [http://forums.novell.com/member.php?userid=100476](http://forums.novell.com/member.php?userid=100476)  
View this thread: [http://forums.novell.com/showthread.php?t=447581](http://forums.novell.com/showthread.php?t=447581)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [November 3, 2011, 10:47pm UTC](https://forums.suse.com/t/php-fileinfo-functions-not-working/21671/16 "2011-11-03T22:47:39Z")

</div>

On Thu, 03 Nov 2011 20:36:02 GMT  
AlexDudko [AlexDudko@no-mx.forums.novell.com](mailto:AlexDudko@no-mx.forums.novell.com) wrote:  
[color=blue]

> Hi, Malcolm!  
> I gave up trying to configure Novell’s PHP and compiled my own  
> instance of Apache+PHP. Of course everything is included.  
> Fortunately I had enough time in late September to wipe away SLED from  
> my notebooks and install another much more stable and reliable OS on  
> them. I’ve left only one installation on my personal laptop just for  
> testing (of course not the primary installation), but after installing  
> several drivers, PHP and many other things from sources, Document  
> Foundation’s LibreOffice only because Novell’s versions are crap  
> there’s not much left of SLED.  
> I had to change my hosting provider as well because they use SLES on  
> their server (that’s why I wanted to keep and configure my SLED - to  
> be able to test scripts in the native environment) and fileinfo and  
> some other functions are not available there.
> 
> [/color]  
> Hi  
> My only concern would be keeping up with with the security issues, one  
> of the bonuses is that CVE fixes aren’t public and are fixed  
> before anyone gets wind of issues from the distributions.

My suggestion is pull the version from the distro that your running…

Best of luck and will always be lurking 😉

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 11.4 (x86\_64) Kernel 2.6.37.6-0.7-desktop  
up 3 days 7:46, 5 users, load average: 0.13, 0.15, 0.14  
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09
