我想在笨使用phpass-0.3,但我得到了下面的錯誤由於open_basedir
:我可以通過open_basedir訪問/ dev/urandom嗎?
一個PHP錯誤遇到
嚴重性:警告
消息:is_readable()[function.is可讀]:open_basedir 限制生效。文件(/ dev/urandom)不在允許的 路徑中:(/ home/phginep:/ usr/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;
}
有什麼我可以做的來解決這個問題?
真的很好的解釋。 – elliotrock 2015-01-01 11:49:22