Fatal Error Call To Undefined Function Hash_hmac
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Call to undefined function hash() in /var/www/site/ problem up vote 0 down vote favorite 1 I have called hash function in my code like (php version 5.2.14 ) $username =hash("sha256",trim($_POST['username'])); $password =hash("sha256",trim($_POST['password'])); but I got error like Call to undefined function hash() in /var/www/site/ What to do ? php share|improve this question edited Apr 8 '11 at 7:44 asked Apr 8 '11 at 7:38 Damir 12.9k56173291 Which php version? –KingCrunch Apr 8 '11 at 7:42 PHP version ..? –Shakti Singh Apr 8 '11 at 7:42 what version of PHP do you have? if you take a look at the documentation jp.php.net/manual/zh/function.hash.php, you would notice that you need a PHP 5 >= 5.1.2 or the pecl module ..... –RageZ Apr 8 '11 at 7:42 Do you have hash enabled in your phpinfo(); –Santosh Linkha Apr 8 '11 at 7:43 Hi there. Which Php version are you using? Be sure hash is defined in that version... –Nobita Apr 8 '11 at 7:43 add a comment| 5 Answers 5 active oldest votes up vote 4 down vote accepted It means it cannot find the function hash(). Checking the manual I see this: (PHP 5 >= 5.1.2, PECL hash >= 1.1) What php version do you run? Try: phpinfo() ?> To check. If it is lower then 5.1.2 you do not have the hash() function available share|improve this answer answered Apr 8 '11 at 7:42 Nanne 46.4k1376112 add a comment| up vote 2 down vote 'hash()' was introduced in PHP 5.1.2, so it's possible you have an older version. share|improve this answer answered Apr 8 '11 at 7:42 ctford 4,44032347 add a comment| up vote 2 down vote Check your PHP version because the hash function is only available for version PHP 5 >= 5.1.2 with PECL hash >= 1.1 share|improve this answer answered Apr 8 '11 at 7:43 Osh Mansor 72021123 add a comment| up
Arduino Yún > Getting PHP Error: Call to undefined function hash_hmac() Print Go Down Pages: [1] Topic: Getting PHP Error: Call to undefined function hash_hmac() (Read 479 times) previous topic - next topic rhammell Newbie Posts: 29 Karma: 1[add] Get started with the Yun - ArduinoMeetsLinux.com Getting PHP Error: Call to undefined function hash_hmac() Mar 04, 2015, 05:48 am I've been doing some web development projects on my Yun and am now getting into using PHP to expand them. So far I've got the basics down. I've followed the instructions to get PHP installed (http://playground.arduino.cc/Hardware/Yun#installing_php), and http://stackoverflow.com/questions/5591975/call-to-undefined-function-hash-in-var-www-site-problem have made some basic web pages that I can connect to and have the Yun execute the PHP code. Right now its just some simple things like printing out some strings using the 'echo' command. I'm working on a project that uses a company's PHP API to display some account information. I've got the code that does exactly this running on one of my hosting services http://forum.arduino.cc/index.php?topic=305252.0 and everything runs fine. However, when I set up a website on my Yun and try to host those same files there, I get the following error when I try to connect to it through the Yun: Call to undefined function hash_hmac()I'm not sure what this error means. I tried google'ing it, and it looks like this was a problem for people who were using PHP prior to version 5. However, the version installed on my Yun is 5.4, so I don't know why this is an issue here. Any thoughts? Is there something I need to update in the php.ini file? Build the next generation of connected devices: http://arduinomeetslinux.com sonnyyu Faraday Member Posts: 3,901 Karma: 307[add] My browser no longer is binding static IP, Floating is the way to go. Re: Getting PHP Error: Call to undefined function hash_hmac() #1 Mar 04, 2015, 07:24 pm Last Edit: Mar 04, 2015, 09:12 pm by sonnyyu Code: [Select]opkg update
opkg install php5 php5-cgi php5-cli Code: [Select]nano hash_hmac.phpCode: [Select]if(function_exists('hash_hmac')){
echo"hash_hmacfunctionsareavailable.\n";
}else{
echo"hash_hmacfunctionsarenotavailable.\n";
}
http://forum.directadmin.com/showthread.php?t=25671 you can post: click the register link above to proceed. To start https://community.invoiceplane.com/t/solved-bsd-install-issue-php-session/136 viewing messages, select the forum that you want to visit from the selection below. Results 1 to 3 of 3 Thread: Fatal error: Call to undefined function: hash_hmac() Thread Tools Show Printable Version Email this Page… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 04-28-2008,04:43 fatal error AM #1 chow View Profile View Forum Posts Visit Homepage Verified User Join Date Aug 2003 Location The Netherlands Posts 125 Fatal error: Call to undefined function: hash_hmac() Getting this error with a script. I believe it's because I run php4. How should I solve this?? Thnx in advance.. Reply With Quote 04-28-2008,02:21 PM #2 smtalk View Profile View Forum Posts fatal error call Verified User Join Date Aug 2006 Location LT, EU Posts 6,688 hash_hmac() is a PHP 5 function. http://us2.php.net/function.hash_hmac. █ Martynas Bendorius █ MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners. Reply With Quote 04-28-2008,02:23 PM #3 chow View Profile View Forum Posts Visit Homepage Verified User Join Date Aug 2003 Location The Netherlands Posts 125 Found the solution.. http://pecl.php.net/package/hash Reply With Quote Quick Navigation MySQL / PHP Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Announcements Official DirectAdmin Announcements Version Updates DirectAdmin Version Updates Required Software Version Updates 3rd Party Software Version Updates Employment Opportunities General DirectAdmin General Discussion Off-Topic Discussion Feedback & Feature Requests Technical Discussion Installation / System Requirements General Technical Discussion & Troubleshooting System-Level Technical Discussion Admin-Level Difficulties Reseller-Level Difficulties User-Level Difficulties CentOS CentOS 6 CentOS 7 Debian Debian 5 64-bit Debian 5 Debian 6.0 Debian 7.0 Debian 8.0 FreeBSD FreeBSD 4.x FreeBSD 5.x FreeBSD 6.x FreeBSD 7.x FreeBSD 7.x 64-bit FreeBSD 8.x 64-bit FreeBSD 9.x 32-bit FreeBSD 9.x 64-bit Operating System (OS) Related Discus
problem, so I know the that software runs fine. In fairness, I'm not quite certain that this is an explicitly InvoicePlane related issue, but it seems a symbiotic relationship. I've learned a lot through this exercise, but I would call myself 'literate', not 'savvy', so it's entirely possible this is a PEBKAC issue - I just can't find it. Without further ado, here's the situation... I have a FreeNAS. I created a 'jail' in which InvoicePlane is to live. Effectively, I'm installing this on a FAMP stack. I followed this tutorial to get Apache, MySQL, and PHP running. phpMyAdmin works fine on it, so Apache is showing up to work. I then followed this tutorial to add Webmin, hoping it'd help me figure out where to upload the ZIP file contents. I did, and then I did a chmod 777 to that folder to ensure that there wouldn't be any write issues. I then got the following error message: A PHP Error was encountered Severity: Notice Message: Only variable references should be returned by reference Filename: core/Common.php Line Number: 257 Fatal error: Call to undefined function hash_hmac() in /usr/local/www/apache24/data/system/libraries/Session.php on line 676 I then followed IceLine's Portmaster tutorial to to get Portmaster working (I'd link, but I can't add more than two - it's on the same Wordpress site as the first link). I was successful, and then let it do a super upgrade of whatever it said was out of date, which yielded this output: Upgrade of pkg-1.3.8_2 to pkg-1.3.8_3Upgrade of db48-4.8.30.0_1 to db48-4.8.30.0_2Upgrade of libtool-2.4.2_3 to libtool-2.4.2.418Upgrade of lzo2-2.06_3 to lzo2-2.08_1Upgrade of pkgconf-0.9.6 to pkgconf-0.9.7Upgrade of ca_root_nss-3.16 to ca_root_nss-3.17.2Upgrade of expat-2.1.0 to expat-2.1.0_1Upgrade of libiconv-1.14_3 to libiconv-1.14_4Upgrade of pcre-8.34_1 to pcre-8.35_1Upgrade of png-1.5.18 to png-1.5.19Upgrade of sqlite3-3.8.4.3 to sqlite3-3.8.6Installation of databases/db5 (db5-5.3.28_2)Upgrade of gdbm-1.11 to gdbm-1.11_2Upgrade of apr-1.5.1.1.5.3 to apr-1.5.1.1.5.4Installation of devel/bison (bison-2.7.1,1)Upgrade of binutils-2.24 to binutils-2.24_1Installation of archivers/zip (zip-3.0_1)Upgrade of mpc-1.0.2 to mpc-1.0.2_1Upgrade of gcc-4.7.3_1 to gcc-4.8.3_