Description of problem: PHP 5.6.1 can not create dir on glusterfs mount Version-Release number of selected component (if applicable): How reproducible: create a web site on glusterfs mount and call php script that tries to create a dir Steps to Reproduce: 1. create a php file <?php $outdir = 'testdir'; mkdir($outdir, 0777, true); if(is_dir($outdir) == true) { echo "found"; } else { echo "not fond"; } ?> 2. put that on clusterfs mout 3. open it via apache http:// Actual results: testdir does not exist Expected results: testdir should exist Additional info: tested with apache 2.4.10 and php 5.6.1
Could you confirm that you made the directory where this PHP script is writing, is writeable by the Apache user? You could try to "chmod ugo+rwx /path/to/mountpoint/parent/of/php/dir". Also check if this is not blocked by SElinux or other security frameworks.
Apache has full write access there are absolutely (100%) no restrictions. This php code works perfect (but uses system calls): system("mkdir testdir"); $d = dir("."); while(($etg = $d->read()) !== false) { echo htmlspecialchars($etg) . "<br />"; } $d->close(); system("rmdir testdir"); I think this is related with the way php is creating a file or directory. BTW - same problem with creating and removing files.
Could you post the output of "ls -ld /parent/dir/where/php/creates/a/dir" and the error messages that the script gets or logs somewhere?
ww1:/ # ls -ld /_www drwxrwxrwx 16 wwwrun users 4096 Sep 11 22:43 /_www ww1:/ # ls -ld /_www/www.e4e.at/ drwxrwxrwx 2 wwwrun users 87 Sep 11 23:14 /_www/www.e4e.at/ ww1:/_www/www.e4e.at # l total 8 drwxrwxrwx 2 wwwrun users 87 Sep 11 23:14 ./ drwxrwxrwx 16 wwwrun users 4096 Sep 11 22:43 ../ -rw-rw-rw- 1 wwwrun users 1035 Sep 11 21:08 _index.html -rw-rw-rw- 1 wwwrun users 212 Sep 11 22:43 index.php -rw-rw-rw- 1 wwwrun users 64 Sep 11 21:07 robots.txt -rw-rw-rw- 1 wwwrun users 183 Sep 11 23:14 test.php -rw-rw-r-- 1 wwwrun users 173 Sep 11 23:09 test.txt ww1:/_www/www.e4e.at # cat index.php <?php $outdir = 'tom'; mkdir($outdir, 775, true); if(is_dir($outdir) == true){ echo "gefunden"; }
Can you please try mounting glusterfs with enable-ino32 and check if the problem persists? thanks.
gluster volume set gv0 nfs.enable-ino32 on does not help, still the same problem php can not create directory
Can you please try mounting your volume as mount -t glusterfs -o enable-ino32 ... and check again? thanks.
Yes, this is much better now. php can create directories now Altough php still can't read directories <?php echo "-----------<br />"; echo "read dir<br />"; echo "-----------<br />"; $d = dir("."); while (($eintrag = $d->read()) !== false) { echo htmlspecialchars($eintrag) . "<br />"; } $d->close(); ?> ist not working on glusterfs vol but reads on ext4 vol same code, same server, two virtualhosts in apache, one rootdoc on glusterfs the other on ext4
What is the filesystem that you are using for gluster bricks? If it is ext4, can you please try if readdir works fine with a xfs based gluster brick? Thanks.
This bug is getting closed because the 3.5 is marked End-Of-Life. There will be no further updates to this version. Please open a new bug against a version that still receives bugfixes if you are still facing this issue in a more current release.