duanchai0028 2012-09-06 18: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-06 18: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条)
编辑
预览

报告相同问题?