Hi,
After installing, deinstalling and reinstalling, checking my Amazon Access Key ID & Amazon Secret Access Key, I'm still getting a 'blank page' while trying to pass the test!

Here is my error.log message:
PHP Fatal error: Call to undefined function hash_hmac() in .../modules/amazon/amazon.module on line 228, referer: http://chaikhana.bodhi3.com/?q=admin/settings/amazon/test

As newbie, I don't really understand what it means, neither what I can do.

Here is the line 228:
$signature = base64_encode(hash_hmac('sha256', $string_to_sign, $secret_access_key, TRUE));

If somebody can help, this would be great!

Comments

dan_metille’s picture

Priority: Normal » Critical

Have also replicate this post on Amazon Web Service forum: http://developer.amazonwebservices.com/connect/thread.jspa?threadID=36402

greggles’s picture

Title: Blank test page & PHP Fatal error: Call to undefined function hash_hmac() in .../modules/amazon/amazon.module on line 228 » make it clear Amazon depends on PHP5

You need to upgrade to PHP5.

I suggest we add to amazon.info a link about requiring php 5.x

dan_metille’s picture

Status: Active » Closed (fixed)

Was on PHP5, but I had trouble because a missing extension for php called pecl-hash.
Now my host master has installed it and everything working fine.

dan_metille’s picture

Status: Closed (fixed) » Active

oups, maybe I should not have closed this!

greggles’s picture

Title: make it clear Amazon depends on PHP5 » make it clear Amazon depends on PHP5 and pecl-hash

Maybe we need a check in hook_requirements for those functions as well and a drupal_set_message during install looking for it.

rfay’s picture

Title: make it clear Amazon depends on PHP5 and pecl-hash » Add hook_requirements for pecl-hash

The info file already requires php 5.2, which I thought always had pecl-hash in it.

rfay’s picture

Priority: Critical » Normal
rfay’s picture

Status: Active » Closed (won't fix)

According to http://us.php.net/manual/en/hash.installation.php, PHP 5.2 always has PECL hash in it. The module requires PHP 5.2 in the .info file. Therefore I'm going to close this. If you can show me how this happened, feel free to reopen.

rfay’s picture

Just a little further information on this - I think I can see how this perhaps happened over time.

Drupal does not *disable* a module that does not meet PHP requirements. It just won't let you enable it. Therefore, if you somehow had Amazon module working before PHP 5.2 was a requirement, and never noticed the red X on the modules page, you never would have known, perhaps.

However, since Drupal does a pretty good job keeping you from enabling it in the first place, I think I'll leave this as 'won't fix'.