Hello,

Can anyone help me out. I am getting this error:

Fatal error: Call to undefined function: mhash()

though the required libraries have been installed at the server. My client is very upset please help me out.

as soon as i call this function I get the above error:

function hmac ($key, $data)
{
return (bin2hex (mhash(MHASH_MD5, $data, $key)));
}

Anurag
v_anurag71@hotmail.com

    Hmm, that looks like its saying that php has not been compiled with the --with-mhash option.

    What does it say if you do a phpinfo() ?

    Somewhere near the top of the output should be configure information like this:

    Configure Command

    './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp' '--with-gd=../gd-1.8.4' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-imap' '--with-kerberos' '--with-mcrypt' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysql' '--with-pear' '--enable-safe-mode' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--enable-versioning' '--with-zlib'

    I 'think' that yours should include --with-mhash or something like that if it is configured.

    Actually, a simpler way would probably be just to put this code in a file:

    print_r (get_loaded_extensions());

    and see if mhash is included.

    see [man]get_loaded_extensions/man for more info.

    hope this helps,

    Sam

      Write a Reply...