title: fopen() works, dio_open() doesn't?
body: <p>Seeing some issues running <a href="http://php.net/manual/en/function.fopen.php" rel="nofollow"><strong>fopen()</strong></a> when <a href="http://php.net/manual/en/function.dio-open.php" rel="nofollow"><strong>dio_open()</strong></a> is working just fine. Here's a test script I wrote to check the issue as it was appearing in a new installation I'm trying to get working.</p>
  
  <pre><code>&lt;?php
          echo "Current User: " . get_current_user() . "&lt;br/&gt;";
          echo "UID: " . getmyuid() . "&lt;br/&gt;";
          echo "GID: " . getmygid() . "&lt;br/&gt;";
          echo "&lt;br/&gt;";
          $foTest = fopen("test.txt","r");
          echo fread($foTest,4);
  
          $fd = dio_open('test.txt', O_RDONLY);
          $read = dio_read($fd);
          echo $read;
          $file = dio_open('test.txt', O_WRONLY | O_CREAT);
  ?&gt;
  </code></pre>
  
  <p>The script outputs the following:</p>
  
  <blockquote>
    <p>Current User: infinitywhack UID: 1004 GID: 1002</p>
    
    <p>test Warning: dio_open(): cannot open file test.txt with flags 0 and
    permissions 0: No such file or directory in
    /var/www/infinity.whacknet.com/public_html/test.php on line 9</p>
    
    <p>Warning: dio_read() expects parameter 1 to be resource, boolean given
    in /var/www/infinity.whacknet.com/public_html/test.php on line 10</p>
    
    <p>Warning: dio_open(): cannot open file test.txt with flags 65 and
    permissions 0: Permission denied in
    /var/www/infinity.whacknet.com/public_html/test.php on line 12</p>
  </blockquote>
  
  <p>This shows the user and group (infinitywhack:www) which is correct. The "test" output here is the content of the test.txt file, that is the code that is running with fopen(). The errors are only given by dio functions.</p>
  
  <p>Here are the permissions for both files:</p>
  
  <pre><code>[root@death public_html]# ls -la test.*
  -r-xr-xr-x. 1 infinitywhack www 342 May 12 23:36 test.php
  -rwxrwxrwx. 1 infinitywhack www   5 May 12 23:06 test.txt
  </code></pre>
  
  <p>I've been scratching my head all night on this one, there's very little documentation on anything dio from what I have found. Very little saying what is needed here. The only thing I could think of was suExec but there aren't any directives in use that would cause this, although surely those same directives would fail for fopen as well if that were the case?</p>
  
  <p>Any help here would be much appreciated!</p>