Seeing some issues running fopen() when dio_open() 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.
<?php
echo "Current User: " . get_current_user() . "<br/>";
echo "UID: " . getmyuid() . "<br/>";
echo "GID: " . getmygid() . "<br/>";
echo "<br/>";
$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);
?>
The script outputs the following:
Current User: infinitywhack UID: 1004 GID: 1002
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
Warning: dio_read() expects parameter 1 to be resource, boolean given in /var/www/infinity.whacknet.com/public_html/test.php on line 10
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
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.
Here are the permissions for both files:
[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
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?
Any help here would be much appreciated!