hash_hmac() not installed

They have: 426 posts

Joined: Feb 2005

Fatal error: Call to undefined function hash_hmac()

I can I install this and do I need to recompile php?

Any help appreciated.

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Here is some information on the PHP function: http://php.net/manual/en/function.hash-hmac.php

Couple questions to further assist:

What version of PHP are you using?
How much control do you have over your server (do you have a dedicated server, shared hosting, etc)?

It seems that some hosts may disable this function, but there are custom implementations defined in the link above.

They have: 426 posts

Joined: Feb 2005

WE are using a dedicated server so I have all control running php5 on gentoo

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

That's interesting because according to http://us2.php.net/manual/en/hash.installation.php, that function is a part of the PHP core. Are you running PHP in safe mode by chance?

The function works on my server, and I don't see any configuration settings in my Apache compile options - both php.ini and WHM's EasyApache.

I found on Stack Overflow that somebody mentioned it's a PECL package ("hash"), but that sorta conflicts with what the PHP manual says.

They have: 426 posts

Joined: Feb 2005

It can be installed as a PECL package or a php extention.

I was also under the impression that HASH_HMAC is part of php5, I am using Gentoo which may be installed slightly differently.

I check php.ini.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.