Topic: Enable FileInfo for PHP 5.3.2

I have the PHP 5.3.2 remi package installed:

Installed Packages
Name       : php
Arch       : x86_64
Version    : 5.3.2
Release    : 1.el5.remi
Size       : 3.5 M
Repo       : installed
Summary    : The PHP HTML-embedded scripting language. (PHP: Hypertext Preprocessor)
URL        : http://www.php.net/
License    : PHP
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated
           : webpages. PHP also offers built-in database integration for several commercial and non-commercial database management
           : systems, so writing a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding is probably
           : as a replacement for CGI scripts.  The php package contains the module which adds support for the PHP language to
           : Apache HTTP Server.

But according to php_info fileinfo is disabled.  I tried to use some example code, but the errors I get say it cannot find packages.

Any idea how to enable it?

Thanks for the help!

Re: Enable FileInfo for PHP 5.3.2

fileinfo extension is enabled by default and provides by php-common.

# yum install php-fileinfo
...
Package php-common-5.3.3-1.fc11.remi.i586 already installed and latest version
Nothing to do

# php -m | grep -i file
fileinfo

# php -r 'print_r(get_defined_functions());' | grep finfo
            [1007] => finfo_open
            [1008] => finfo_close
            [1009] => finfo_set_flags
            [1010] => finfo_file
            [1011] => finfo_buffer

phpinfo also report this.

 # php -i
...
fileinfo support => enabled
version => 1.0.5-dev

Except if you read the "configure" options which are about "build" time, not about "install" time.

+

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

3 (edited by dunnma 2010-09-02 15:36:53)

Re: Enable FileInfo for PHP 5.3.2

Hmmm...maybe that is my problem.  I get the following:

yum install php-fileinfo
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * epel: mirrors.tummy.com
 * updates: mirrors.tummy.com
 * base: ftp.linux.ncsu.edu
 * addons: mirror.denver.openreaction.net
 * extras: yum.singlehop.com
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-Fileinfo.x86_64 0:1.0.4-2.el5 set to be updated
--> Processing Dependency: php-api = 20041225 for package: php-pecl-Fileinfo
--> Finished Dependency Resolution
php-pecl-Fileinfo-1.0.4-2.el5.x86_64 from epel has depsolving problems
  --> Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-2.el5.x86_64 (epel)
Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-2.el5.x86_64 (epel)

Then if I "yum install php-api" I get:

yum install php-api
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * epel: mirrors.tummy.com
 * updates: mirrors.tummy.com
 * base: ftp.linux.ncsu.edu
 * addons: mirror.denver.openreaction.net
 * extras: yum.singlehop.com
Setting up Install Process
Parsing package install arguments
Package matching php-common-5.2.13-jason.1.x86_64 already installed. Checking for update.
Nothing to do

I am assuming then I need to delete the php-common that is installed and install yours?

So:

yum remove php-common
yum install -enablerepo=remi php-common

Sound about right?

Thanks for the help

UPDATE:

So this is weird:

yum info php-common
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * epel: mirrors.tummy.com
 * updates: mirrors.tummy.com
 * base: ftp.linux.ncsu.edu
 * addons: mirror.denver.openreaction.net
 * extras: yum.singlehop.com
Installed Packages
Name       : php-common
Arch       : x86_64
Version    : 5.3.2
Release    : 1.el5.remi
Size       : 5.1 M
Repo       : installed
Summary    : Common files for PHP
URL        : http://www.php.net/
License    : PHP
Description: The php-common package contains files used by both the php package and the php-cli package.

Somehow I have 2 packages installed?

Re: Enable FileInfo for PHP 5.3.2

You have the php-common, so you have the fileinfo extension.
+

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi