title: Can I access /dev/urandom with open_basedir in effect?
body: <p>I want to use phpass-0.3 in Codeigniter, but I get the following error due to <code>open_basedir</code>:</p>
  
  <blockquote>
    <p>A PHP Error was encountered    <br/> Severity: Warning    <br/>
    Message: is_readable() [function.is-readable]: open_basedir
    restriction in effect. File(/dev/urandom) is not within the allowed
    path(s): (/home/phginep:/usr/lib/php:/usr/local/lib/php:/tmp)<br/>
    Filename: phpass-0.3/PasswordHash.php  <br/>   Line Number: 51<br/></p>
  </blockquote>
  
  <p>Following code:</p>
  
  <pre><code>function get_random_bytes($count)
  {
      $output = '';
      if (is_readable('/dev/urandom') &amp;&amp;    //Line Number: 51
          ($fh = @fopen('/dev/urandom', 'rb'))) {
          $output = fread($fh, $count);
          fclose($fh);
      }
  
      if (strlen($output) &lt; $count) {
          $output = '';
          for ($i = 0; $i &lt; $count; $i += 16) {
              $this-&gt;random_state =
                  md5(microtime() . $this-&gt;random_state);
              $output .=
                  pack('H*', md5($this-&gt;random_state));
          }
          $output = substr($output, 0, $count);
      }
  
      return $output;
  }
  </code></pre>
  
  <p>Is there anything I can do to get around this?</p>