Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Hosting Requirements

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Missing hash module of php


Reply

2 Posts   1226 Views

Avatar
Pango853

29 September 2010 at 7:46pm (Last edited: 29 September 2010 7:47pm), Community Member, 2 Posts

According to Silverstripe requirements(http://doc.silverstripe.org/server-requirements#php), hash module seems to be necessary. I knew it is default after php 5.2. Anyway, unfortunately that my server(php 5.2.5) does not provide that module.

I checked the source and found that only "hash_algos" is necessary(just seems to be). So I put the following code in the main.php and got the Silverstripe worked.
------------------------
if(!function_exists('hash')){
   function hash_algos(){   return Array('md4','md5','sha1','sha256',... ,'haval256,5');}
}
------------------------

I am starting to develop a website with this server I mentioned above. Here, I want to ask if hash will cause any kind of fatal problem. Because I really don't want any unsolvable problem in the coming future, especially I cannot change the requirement of this server.

Any advice or comment will be very very appreciated. Thank you.

Avatar
Willr

30 September 2010 at 8:37pm Forum Moderator, 5511 Posts

Wow I don't think I have ever heard of it being disabled.

I think you need to define 2 functions at least hash() and like you have hash_algos(). Looks like it could work without hash() though. Take a look at PasswordEncryptor::encrypt();