How to switch hash_algos() on ? I'm with Php 5.2.11

会有一股神秘感。 提交于 2020-01-04 05:48:08

问题


My PHP version is 5.2.11 which is higher than the required version for hash_algos. however, when I run it either via web or command line, it returns

Fatal error: Call to undefined function hash_algos() 

So as for other Hash functions. Do i have to turn anything on in the php.inin or what should I do?

I have checked the php --re hash
and the extension isn't there. I am very sure it is either not there or disabled.

I also tried to installed it (PECL) but don't know how.


回答1:


You'll need to install the Hash PECL module:

http://pecl.php.net/package/hash

To do this, you're going to need to have server access. Make sure you have PECL installed:

apt-get install php5-pear php5-dev

and run

pecl install hash

Hope this helps!




回答2:


hash_algos and the related functions in the Hash module are built into PHP, so there's no extension you need to enable in your php.ini.

Given that you can't use the function anyway, it has most likely been disabled during compilation of PHP.

If you aren't able to recompile PHP, or otherwise install a version where this hsan't been disabled, you should be able to install the PECL module like described by mattbasta.



来源:https://stackoverflow.com/questions/3946638/how-to-switch-hash-algos-on-im-with-php-5-2-11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!