Solved Opencart & PHP: Call to undefined function hash()

Hello,

I'm trying to install opencart (latest version) on a FreeBSD 10. I'm getting the following error:

Code:
FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined function hash() in /usr/local/www/website/system/library/encryption.php on line 6"

I'm using php-fpm(8) with lang/php56 and lang/php55. I tried both ports and pkg versions. I always get the same error which is weird, because 'hash' methods should be build-in to PHP 5.5 and PHP 5.6.

My extensions.ini and php.ini seems to be good. Any ideas how to tackle this?

Thanks,

PA
 
I just ran into this same scenario associated with ZenPhoto. I downloaded the php56-extensions package (a plethora of stuff) and now a missing
Code:
hash()
function error is resolved. You know, I'm an old programmer (sixty-six years old next week) and I write a lot of languages, but this PHP PIG is the surliest piece-of-work that I've ever dealt with. Always having to add something "MySQL" here, an "extension" there, . . .little wonder I hear so many complaints from other users.

If PHP were a new car . . .you'd still have to purchase tires, have it painted, install doors, buy a battery, install brake fluid . . .well, you get the idea. Seems like with the base PHP install, about all you can do is execute a
Code:
echo "Hello World!";
 
There's no need to install everything from lang/php56-extensions. In this case only security/php56-hash would be enough. The extensions port is a so-called meta-port. It simply depends on a bunch of PHP modules, including this one.
Actually I did only select a subset of modules from the config list. (Thanks to your solution for being able to rerun and display of the make config options list.) I tried to think ahead of what I might need in the future and selected a few extras. ;)
 
Actually I did only select a subset of modules from the config list. (Thanks to your solution for being able to rerun and display of the make config options list.) I tried to think ahead of what I might need in the future and selected a few extras. ;)

The metaport is great if you don't know what you need but if you already know what you need then you would be better off explicitly installing what you need so queries of what packages you asked to be installed like pkg query -e '%a = 0' %o or trimming back old packages with pkg autoremove work as intended. This will confine you to always using ports, else if you use the public repositories it will install a bunch of extra stuff you didn't really need.
 
Back
Top