duanchai0028 2012-09-07 02:34
浏览 32
已采纳

我的PHP的hash_algos()函数不再有效

I'm not entirely sure what version of PHP, but I'm thinking it's in the 5.2 (Relatively new installtion of XAMPP). There was a certain site I built and it relied heavily on the php function hash_algos() to populate a drop down list, but it seems as of late that the hash_algos() returns absolutely nothing. Also, using windows, if XAMPP didn't give it away.

The site used to work, but doesn't anymore, and I'm not sure why, I haven't changed anything in the code. Here's the part of the site that isn't working

<select name="method" id="method">
<?
foreach(hash_algos() as $m)
{
echo "<option value=\"".$m."\">".$m."</option>";
}
?>
</select>
  • 写回答

2条回答 默认 最新

  • dsgwii4867 2012-09-07 02:37
    关注

    You need to have the Hash PECL package enabled.

    This question may be of use to you: How to switch hash_algos() on ? I'm with Php 5.2.11

    Edit: Since you're on Windows, you'll likely have to compile the "Hash" package yourself. It appears to be available on the PECL website but is no longer maintained.

    To compile from source, PHP has a step by step guide.

    After you've compiled the DLL or got ahold of one, you need to add it to your php.ini file.

    You'll need to add a line like the following:

    extension=php_hash.dll
    

    More information is available on PHP's Windows site.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)