【发布时间】:2012-04-28 12:25:19
【问题描述】:
我想在 Codeigniter 中使用 phpass-0.3,但由于open_basedir 而出现以下错误:
遇到 PHP 错误
严重性:警告
消息:is_readable() [function.is-readable]: open_basedir 限制生效。文件(/dev/urandom)不在允许范围内 路径:(/home/phginep:/usr/lib/php:/usr/local/lib/php:/tmp)
文件名:phpass-0.3/PasswordHash.php
行号:51
以下代码:
function get_random_bytes($count)
{
$output = '';
if (is_readable('/dev/urandom') && //Line Number: 51
($fh = @fopen('/dev/urandom', 'rb'))) {
$output = fread($fh, $count);
fclose($fh);
}
if (strlen($output) < $count) {
$output = '';
for ($i = 0; $i < $count; $i += 16) {
$this->random_state =
md5(microtime() . $this->random_state);
$output .=
pack('H*', md5($this->random_state));
}
$output = substr($output, 0, $count);
}
return $output;
}
我能做些什么来解决这个问题吗?
【问题讨论】:
标签: php codeigniter phpass