PHP finfo

I’m trying to use finfo in my site’s php programs. I’ve selected PHP 5.3.x Fast CGI for my PHP mode.

When I try to call finfo_open() I get the following error:

Similarly, I get an error when I try to instantiate a new object using:

[php]$finfo = new finfo(FILEINFO_MIME_TYPE);[/php]

I thought finfo was built-in for PHP 5.3.x


Nope! It has to be loaded as an extension.

I guess I misinterpreted the statement in the manual: “This extension is enabled by default as of PHP 5.3.0”

I did a phpinfo() and see this in the Configure Command:


Does this mean that this module should be loaded, or does it just mean that it is “available” to be loaded? If the latter, how do I load it?


See DreamHost Wiki - PHP.ini - PHP 5.3

@atropos7 – thanks!

I followed the instructions and created the file: ~/.php/5.3

In it I placed the following line:

Seems to work!

Any other tips are appreciated.

I followed the steps by creating phprc file in ~/.php/5.3 directory that contain a single line of characters:
extension =

I continue to get Fatal error: Call to undefined function finfo_open() errors.

I am running version 5.3.13 of PHP with Fast CGI enabled.


Do you get any error messages besides “could not open input file: test” if you try running this command in a shell?

According to the Dreamhost panel, I was running “PHP 5.3.xFASTCGI”

but when I entered in the terminal

“php -v”

It said I was running 5.2.17.


Just switched my domain to “PHP 5.4.x…”

So maybe in a few minutes I’ll actually be running PHP 5.3.something

The command prompt will always use 5.2.17, to change that you need to specify which php you want such as


the php setting in the panel will effect which php apache sees.