0

We custom build up our PHP installs due to some historic reasons and it gets installed into our custom compile of Apache.

We are now trying to get Fileinfo to load into the PHP build and have tried the usual Pecl install fileinfo and enabling it in the php.ini but it hasn't worked.

Even stranger is that fileinfo shows in phpinfo() output just doesn't list any versions. Trying to run the base finfo functions gives the following error

Fatal error: Class 'finfo' not found

System is Debian Linux. PHP is 5.2.10. We are unable to move to 5.3.0 due to Joomla not working with it.

If anyone can direct us to what could be causing this it'd be much appreciated.

3 Answers 3

0

What is your php.ini extension_dir set to?

In our case, pecl installs extensions to /usr/local/lib/php/ext/no-debug-non-zts-20060613, but the extension_dir ini setting is either "./" or "/usr/local/lib/php/ext". The output of the pecl install should have told you where it installed the extension, so you'll just need to change your extension_dir to match or move the fileinfo.so file to the directory specified in php.ini.

1
  • Changing the ext dir is how we managed to get the module to load. It just wasn't actually function afterwards even though it displayed in phpinfo();
    – Ryaner
    Aug 7, 2009 at 21:40
0

I had the same problem before. First got fileinfo extension loaded (should display in phpinfo() ). Then check whether there is a symbol link called 'magic' in /usr/share. If not just create one link to file/magic.

0

We managed to sort this by removing magic_mime and then compiling fileinfo directly into the php install.

remove magic_mime from the ext directory inside of the php source
grab Fileinfo source and put inside of the ext directory
run autoconf in the root php source directory
configure and compile normally

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .